From 20745375afb333fd3d442006f3c6ebbebe195dab Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Sep 2021 20:45:04 +0200 Subject: 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 --- apt-pkg/pkgcachegen.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/pkgcachegen.cc') 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 DynPrv(Prv); + Dynamic DynVer(Ver); for (Prv = M.ProvidesList(); Prv.end() == false; ++Prv) { if ((Prv->Flags & pkgCache::Flag::ArchSpecific) != 0) continue; - pkgCache::VerIterator Ver = Prv.OwnerVer(); - Dynamic 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; -- cgit v1.2.3-70-g09d2