Browse Source

fix M-A:foreign provides creation for unknown archs

Architectures for packages which do not belong to the native nor a
foreign architecture (dubbed barbarian for now) which are marked
M-A:foreign still provide in their own architecture even if not for
others. Also, other M-A:foreign (and allowed) packages provide in these
barbarian architectures.
tags/debian/1.2
David Kalnischkies 5 years ago
parent
commit
62428dbc17
4 changed files with 26 additions and 6 deletions
  1. +4
    -0
      apt-pkg/deb/deblistparser.cc
  2. +12
    -4
      apt-pkg/pkgcachegen.cc
  3. +3
    -1
      test/integration/test-multiarch-allowed
  4. +7
    -1
      test/integration/test-multiarch-foreign

+ 4
- 0
apt-pkg/deb/deblistparser.cc View File

@@ -907,8 +907,12 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
return false;
} else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) {
if (APT::Configuration::checkArchitecture(Arch))
{
if (NewProvidesAllArch(Ver, Package, Version, 0) == false)
return false;
}
else if (NewProvides(Ver, Package, Arch, Version, 0) == false)
return false;
} else {
if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
{


+ 12
- 4
apt-pkg/pkgcachegen.cc View File

@@ -572,8 +572,7 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
}
else // Group the Packages together
{
// but first get implicit provides done
if (APT::Configuration::checkArchitecture(Pkg.Arch()) == true)
// if sibling is provided by another package, this one is too
{
pkgCache::PkgIterator const M = Grp.FindPreferredPkg(false); // native or any foreign pkg will do
if (M.end() == false) {
@@ -588,22 +587,31 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed ||
((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign &&
(Prv->Flags & pkgCache::Flag::MultiArchImplicit) == 0))
{
if (APT::Configuration::checkArchitecture(Ver.ParentPkg().Arch()) == false)
continue;
if (NewProvides(Ver, Pkg, Prv->ProvideVersion, Prv->Flags) == false)
return false;
}
}
}


}
// let M-A:foreign package siblings provide this package
{
pkgCache::PkgIterator P;
pkgCache::VerIterator Ver;
Dynamic<pkgCache::PkgIterator> DynP(P);
Dynamic<pkgCache::VerIterator> DynVer(Ver);

for (P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
{
if (APT::Configuration::checkArchitecture(P.Arch()) == false)
continue;
for (Ver = P.VersionList(); Ver.end() == false; ++Ver)
if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
if (NewProvides(Ver, Pkg, Ver->VerStr, pkgCache::Flag::MultiArchImplicit) == false)
return false;
}
}
// and negative dependencies, don't forget negative dependencies
{


+ 3
- 1
test/integration/test-multiarch-allowed View File

@@ -255,7 +255,9 @@ configarchitecture 'amd64' 'i386'
insertinstalledpackage 'foo' 'armel' '1' 'Multi-Arch: allowed'
insertinstalledpackage 'coolfoo' 'armel' '1' 'Multi-Arch:allowed
Provides: coolbar'
insertinstalledpackage 'bar-needer' 'armel' '1.0' 'Depends: coolbar:any'

testsuccess aptget check
testsuccessequal 'Reading package lists...
Building dependency tree...
The following additional packages will be installed:
@@ -293,7 +295,7 @@ The following packages will be REMOVED:
The following NEW packages will be installed:
coolfoo needscoolfoover0
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
Remv coolfoo:armel [1]
Remv coolfoo:armel [1] [bar-needer:armel ]
Inst coolfoo (1 unstable [amd64])
Inst needscoolfoover0 (1 unstable [amd64])
Conf coolfoo (1 unstable [amd64])


+ 7
- 1
test/integration/test-multiarch-foreign View File

@@ -250,7 +250,9 @@ msgmsg 'switch to multi-arch with barbarian architecture'
insertinstalledpackage 'foo' 'armhf' '1.0' 'Multi-Arch: foreign'
insertinstalledpackage 'bar' 'armhf' '1.0' 'Provides: bar-provider
Multi-Arch: foreign'
insertinstalledpackage 'bar-needer' 'armhf' '1.0' 'Depends: bar-provider'

testsuccess aptget check
testsuccessequal 'Reading package lists...
Building dependency tree...
The following additional packages will be installed:
@@ -274,8 +276,12 @@ The following packages will be REMOVED:
The following NEW packages will be installed:
bar cool-bar
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
Remv bar:armhf [1.0]
Remv bar:armhf [1.0] [bar-needer:armhf ]
Inst bar (1.0 unstable [amd64])
Inst cool-bar (1.0 unstable [amd64])
Conf bar (1.0 unstable [amd64])
Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar -s

# a barbarian doesn't satisfy another either
insertinstalledpackage 'bar-needer2' 's390x' '1.0' 'Depends: bar-provider'
testfailure aptget check

Loading…
Cancel
Save