]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/pkgcachegen.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 25 Mar 2011 19:17:32 +0000 (20:17 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 25 Mar 2011 19:17:32 +0000 (20:17 +0100)
  - make "all"->"native" an implementation detail of NewPackage
    rather than rewrite it in higher methods

apt-pkg/pkgcache.cc
apt-pkg/pkgcachegen.cc
debian/changelog

index 7014aee228bc2089033745d84e7404e16cfdb024..dbcbd9c26a6990b2eb1e793c5b2e31846ba150a5 100644 (file)
@@ -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)
index d44dbf3a973fe4c86467842b5069272feb962e1b..ae031fee4641f7279f3c36ce8ed95a3d511f504f 100644 (file)
@@ -178,12 +178,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       if (PackageName.empty() == true)
         return false;
 
-      /* Treat Arch all packages as the same as the native arch. */
-      string Arch;
-      if (List.ArchitectureAll() == true)
-        Arch = _config->Find("APT::Architecture");
-      else
-        Arch = List.Architecture();
+      string const Arch = List.Architecture();
  
       // Get a pointer to the package structure
       pkgCache::PkgIterator Pkg;
@@ -484,7 +479,7 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name
    // Set the name, arch and the ID
    Pkg->Name = Grp->Name;
    Pkg->Group = Grp.Index();
-   map_ptrloc const idxArch = WriteUniqString(Arch.c_str());
+   map_ptrloc const idxArch = WriteUniqString((Arch == "all") ? _config->Find("APT::Architecture") : Arch.c_str());
    if (unlikely(idxArch == 0))
       return false;
    Pkg->Arch = idxArch;
@@ -787,7 +782,8 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver,
    pkgCache &Cache = Owner->Cache;
 
    // We do not add self referencing provides
-   if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch())
+   if (Ver.ParentPkg().Name() == PkgName && (PkgArch == Ver.ParentPkg().Arch() ||
+       (PkgArch == "all" && _config->Find("APT::Architecture") == Ver.ParentPkg().Arch())))
       return true;
    
    // Get a structure
index 90a56968cb4427f9196eac06eb37bae1ac06bc62..e46c69ca4ed384e8ce89b111d99f9a32a5cc8755 100644 (file)
@@ -15,8 +15,11 @@ apt (0.8.13.1) UNRELEASED; urgency=low
       as suggested by Charles Plessy (Closes: #619083)
   * apt-pkg/depcache.cc:
     - remove pseudo handling leftover from SetReInstall
+  * apt-pkg/pkgcachegen.cc:
+    - make "all"->"native" an implementation detail of NewPackage
+      rather than rewrite it in higher methods
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 25 Mar 2011 20:06:03 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 25 Mar 2011 20:15:18 +0100
 
 apt (0.8.13) unstable; urgency=low