]> git.saurik.com Git - apt.git/commitdiff
store ':any' pseudo-packages with 'any' as architecture
authorDavid Kalnischkies <david@kalnischkies.de>
Sat, 5 Sep 2015 10:58:04 +0000 (12:58 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 14 Sep 2015 13:22:18 +0000 (15:22 +0200)
Previously we had python:any:amd64, python:any:i386, … in the cache and
the dependencies of an amd64 package would be on python:any:amd64, of an
i386 on python:any:i386 and so on. That seems like a relatively
pointless endeavor given that they will all be provided by the same
packages and therefore also a waste of space.

Git-Dch: Ignore

apt-pkg/deb/deblistparser.cc
apt-pkg/pkgcache.cc
test/integration/test-multiarch-allowed

index 7da908d751e4a73350d0d0441241a4adf9cd1432..6a802b39f73568e35a41ff1bdd270b0c0a2704a8 100644 (file)
@@ -791,11 +791,16 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
         return _error->Error("Problem parsing dependency %s",Tag);
       size_t const found = Package.rfind(':');
 
-      if (found == string::npos || strcmp(Package.c_str() + found, ":any") == 0)
+      if (found == string::npos)
       {
         if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
            return false;
       }
+      else if (strcmp(Package.c_str() + found, ":any") == 0)
+      {
+        if (NewDepends(Ver,Package,"any",Version,Op,Type) == false)
+           return false;
+      }
       else
       {
         string Arch = Package.substr(found+1, string::npos);
@@ -857,7 +862,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
    if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
    {
       string const Package = string(Ver.ParentPkg().Name()).append(":").append("any");
-      return NewProvidesAllArch(Ver, Package, Ver.VerStr(), pkgCache::Flag::MultiArchImplicit);
+      return NewProvides(Ver, Package, "any", Ver.VerStr(), pkgCache::Flag::MultiArchImplicit);
    }
    else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
       return NewProvidesAllArch(Ver, Ver.ParentPkg().Name(), Ver.VerStr(), pkgCache::Flag::MultiArchImplicit);
index 9d3929cd933758ae189ace642f06e41c77b9e837..73907491065c83a3b417a1b0fc49e0ff14d290b4 100644 (file)
@@ -546,7 +546,7 @@ std::string pkgCache::PkgIterator::FullName(bool const &Pretty) const
 {
    string fullname = Name();
    if (Pretty == false ||
-       (strcmp(Arch(), "all") != 0 &&
+       (strcmp(Arch(), "all") != 0 && strcmp(Arch(), "any") != 0 &&
        strcmp(Owner->NativeArch(), Arch()) != 0))
       return fullname.append(":").append(Arch());
    return fullname;
index 2eb479c177efcaf350fc3a784c78ff5e2224303f..f050c1fd9c0ce06460c1b1e0593a497e9dd30906 100755 (executable)
@@ -126,7 +126,7 @@ The following packages have unmet dependencies:
 E: Unable to correct problems, you have held broken packages."
 NEEDSFOO2FOREIGN="$BADPREFIX
 The following packages have unmet dependencies:
- needsfoover2:i386 : Depends: foo:any:i386 (>= 2)
+ needsfoover2:i386 : Depends: foo:any (>= 2)
 E: Unable to correct problems, you have held broken packages."
 testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
 testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s
@@ -153,7 +153,6 @@ E: Unable to correct problems, you have held broken packages." aptget install fo
 testfailureequal "$BADPREFIX
 The following packages have unmet dependencies:
  hatesfooany : Conflicts: foo:any
-               Conflicts: foo:any:i386
 E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
 testsuccessequal 'Reading package lists...
 Building dependency tree...