From 566046f403acb3f50df78be93ea3b68b9f2c3e7b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 25 Mar 2011 20:17:32 +0100 Subject: * apt-pkg/pkgcachegen.cc: - make "all"->"native" an implementation detail of NewPackage rather than rewrite it in higher methods --- apt-pkg/pkgcache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/pkgcache.cc') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 7014aee22..dbcbd9c26 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -321,7 +321,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const { /* Most of the time the package for our native architecture is the one we add at first to the cache, but this would be the last one we check, so we do it now. */ - if (Arch == "native" || Arch == myArch) { + if (Arch == "native" || Arch == myArch || Arch == "all") { Arch = myArch; pkgCache::Package *Pkg = Owner->PkgP + S->LastPackage; if (stringcasecmp(Arch, Owner->StrP + Pkg->Arch) == 0) -- cgit v1.2.3 From 60dcec6d513859698177c10dabfc9db184363064 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 28 Mar 2011 12:29:38 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - create foo:any provides for all architectures for an allowed package --- apt-pkg/pkgcache.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/pkgcache.cc') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index dbcbd9c26..c6326abf1 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -317,6 +317,11 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const { if (unlikely(IsGood() == false || S->FirstPackage == 0)) return PkgIterator(*Owner, 0); + /* If we accept any package we simply return the "first" + package in this group (the last one added). */ + if (Arch == "any") + return PkgIterator(*Owner, Owner->PkgP + S->FirstPackage); + static string const myArch = _config->Find("APT::Architecture"); /* Most of the time the package for our native architecture is the one we add at first to the cache, but this would be the @@ -328,11 +333,6 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const { return PkgIterator(*Owner, Pkg); } - /* If we accept any package we simply return the "first" - package in this group (the last one added). */ - if (Arch == "any") - return PkgIterator(*Owner, Owner->PkgP + S->FirstPackage); - /* Iterate over the list to find the matching arch unfortunately this list includes "package noise" (= different packages with same calculated hash), -- cgit v1.2.3