summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-09-03 20:45:04 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2021-09-04 15:35:15 +0200
commit20745375afb333fd3d442006f3c6ebbebe195dab (patch)
tree63ac397573697971b346f2f51049418c81a56e99 /apt-pkg/pkgcachegen.cc
parent017b3d0ae5232628c15324204e607e76487afb99 (diff)
Do not make provides of M-A:allowed implicit M-A:foreign
As we don't know which architectures we will deal with and to avoid creating many "unneeded" packages (and provides) the cache generation uses a scheme of on-demand creation (see ecc138f858). This assumed a particular handling of :any which got changed later (3addaba1ff) making this code path not only no longer needed for M-A:allowed, but actually wrong as it would go on and create provides for the explicit Provides of a package as if the package would be M-A:foreign. The result was that a package A:amd64 providing B tagged as M-A:allowed would satisfy a "C:armel depends on B". Note that this bug does NOT effect "C:armel depends on A" which is (correctly) not satisfied as before. References: ecc138f858, 3addaba1ff
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index b4fd0641e..807f3bf6c 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -626,16 +626,16 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
pkgCache::PkgIterator const M = Grp.FindPreferredPkg(false); // native or any foreign pkg will do
if (M.end() == false) {
pkgCache::PrvIterator Prv;
+ pkgCache::VerIterator Ver;
Dynamic<pkgCache::PrvIterator> DynPrv(Prv);
+ Dynamic<pkgCache::VerIterator> DynVer(Ver);
for (Prv = M.ProvidesList(); Prv.end() == false; ++Prv)
{
if ((Prv->Flags & pkgCache::Flag::ArchSpecific) != 0)
continue;
- pkgCache::VerIterator Ver = Prv.OwnerVer();
- Dynamic<pkgCache::VerIterator> DynVer(Ver);
- if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed ||
- ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign &&
- (Prv->Flags & pkgCache::Flag::MultiArchImplicit) == 0))
+ Ver = Prv.OwnerVer();
+ if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign &&
+ (Prv->Flags & pkgCache::Flag::MultiArchImplicit) == 0)
{
if (APT::Configuration::checkArchitecture(Ver.ParentPkg().Arch()) == false)
continue;