summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-04-06 16:47:58 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-04-06 16:47:58 +0200
commit959470da73e7dc325321bb5024f1fd6d24bd9e9b (patch)
tree3ea881cddcc667c28fd5e97961254eb29b138890 /apt-pkg/pkgcachegen.cc
parenteddc9dd092138fee6e71f92ba41dc21918a03f73 (diff)
* apt-pkg/pkgcache.cc:
- use the native Architecture stored in the cache header instead of loading it from configuration as suggested by Julian Andres Klode
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index b0ee04554..9820fde81 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -479,7 +479,8 @@ 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 == "all") ? _config->Find("APT::Architecture") : Arch.c_str());
+ // all is mapped to the native architecture
+ map_ptrloc const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : WriteUniqString(Arch.c_str());
if (unlikely(idxArch == 0))
return false;
Pkg->Arch = idxArch;
@@ -783,7 +784,7 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver,
// We do not add self referencing provides
if (Ver.ParentPkg().Name() == PkgName && (PkgArch == Ver.ParentPkg().Arch() ||
- (PkgArch == "all" && _config->Find("APT::Architecture") == Ver.ParentPkg().Arch())))
+ (PkgArch == "all" && strcmp((Cache.StrP + Cache.HeaderP->Architecture), Ver.ParentPkg().Arch()) == 0)))
return true;
// Get a structure