Browse Source

* apt-pkg/cacheiterators.h:

- return the correct version arch for all+foreign, too

The flag is interpreted at a few other places in different styles so
this commit ensures that the flag check is consistent everywhere
(checking for Same in flag style is a bit too much as it isn't used
 in combination with others anyway, but who knows and just for
 consistency)
debian/1.8.y
David Kalnischkies 10 years ago
parent
commit
2a2a7ef4df
  1. 2
      apt-pkg/cacheiterators.h
  2. 4
      apt-pkg/deb/dpkgpm.cc
  3. 2
      apt-pkg/packagemanager.cc
  4. 4
      cmdline/apt-get.cc
  5. 6
      debian/changelog
  6. 9
      test/integration/framework
  7. 22
      test/integration/test-dpkg-assert-multi-arch

2
apt-pkg/cacheiterators.h

@ -207,7 +207,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
inline const char *Arch() const {
if (S->MultiArch == pkgCache::Version::All)
if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All)
return "all";
return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
};

4
apt-pkg/deb/dpkgpm.cc

@ -1093,9 +1093,9 @@ bool pkgDPkgPM::Go(int OutStatusFd)
pkgCache::VerIterator PkgVer;
std::string name = I->Pkg.Name();
if (Op == Item::Remove || Op == Item::Purge)
PkgVer = I->Pkg.CurrentVer();
PkgVer = I->Pkg.CurrentVer();
else
PkgVer = Cache[I->Pkg].InstVerIter(Cache);
PkgVer = Cache[I->Pkg].InstVerIter(Cache);
name.append(":").append(PkgVer.Arch());
char * const fullname = strdup(name.c_str());
Packages.push_back(fullname);

2
apt-pkg/packagemanager.cc

@ -733,7 +733,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same)
if (Immediate == true && (instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
{
/* Do lockstep M-A:same unpacking in two phases:
First unpack all installed architectures, then the not installed.

4
cmdline/apt-get.cc

@ -2872,12 +2872,12 @@ bool DoBuildDep(CommandLine &CmdL)
forbidden = "Multi-Arch: same";
// :native gets the buildArch
}
else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign)
else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
{
if (colon != string::npos)
forbidden = "Multi-Arch: foreign";
}
else if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed)
else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
{
if (colon == string::npos)
Pkg = Ver.ParentPkg().Group().FindPkg(hostArch);

6
debian/changelog

@ -4,7 +4,11 @@ apt (0.8.16~exp12) experimental; urgency=low
* apt-pkg/deb/dpkgpm.cc:
- fix segfault on pkg removal
-- Michael Vogt <michael.vogt@ubuntu.com> Thu, 19 Jan 2012 16:28:03 +0100
[ David Kalnischkies ]
* apt-pkg/cacheiterators.h:
- return the correct version arch for all+foreign, too
-- David Kalnischkies <kalnischkies@gmail.com> Thu, 19 Jan 2012 18:38:33 +0100
apt (0.8.16~exp11) experimental; urgency=low

9
test/integration/framework

@ -25,7 +25,14 @@ msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; }
msgnmsg() { echo -n "${CMSG}$1${CNORMAL}" >&2; }
msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}" >&2; }
msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}" >&2; }
msgtest() { echo -n "${CINFO}$1 ${CCMD}$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} …${CNORMAL} " >&2; }
msgtest() {
while [ -n "$1" ]; do
echo -n "${CINFO}$1${CCMD} " >&2;
echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2;
shift 2
done
echo -n "…${CNORMAL} " >&2;
}
msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; }
msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; }

22
test/integration/test-dpkg-assert-multi-arch

@ -10,13 +10,13 @@ buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable'
buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign'
buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same'
buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable'
buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign'
setupaptarchive
testqualifier() {
msgtest 'Test for correct qualifier mode' $2
GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
msgtest 'Test with' $1 'for correct qualifier mode' $2
GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -v -- '--unpack' | sed -e 's/^.*--[^u][^ ]* \([^ ]*\).*$/\1/')"
if [ "$GIVEN" = "$2" ]; then
msgpass
else
@ -49,11 +49,17 @@ testqualifier 'all-pkg:amd64' 'all-pkg'
testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
insertinstalledpackage 'all-pkg' 'amd64' '1.0'
insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
testqualifier 'all-pkg' 'all-pkg'
testqualifier 'all-pkg:amd64' 'all-pkg'
testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
insertinstalledpackage 'always-all-pkg' 'all' '1.0'
insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
testqualifier 'all-pkg-' 'all-pkg'
testqualifier 'all-foreign-pkg-' 'all-foreign-pkg'
testqualifier 'always-all-pkg-' 'always-all-pkg'
testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg'
# multiarch dpkg (new interface version)
@ -78,8 +84,14 @@ testqualifier 'all-pkg:amd64' 'all-pkg:all'
testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
insertinstalledpackage 'all-pkg' 'amd64' '1.0'
insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
testqualifier 'all-pkg' 'all-pkg:all'
testqualifier 'all-pkg:amd64' 'all-pkg:all'
testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
insertinstalledpackage 'always-all-pkg' 'all' '1.0'
insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
testqualifier 'all-pkg-' 'all-pkg:amd64'
testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64'
testqualifier 'always-all-pkg-' 'always-all-pkg:all'
testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all'

Loading…
Cancel
Save