write the native architecture as unique string into the cache header
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 13 Oct 2012 09:16:30 +0000 (11:16 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 13 Oct 2012 09:16:30 +0000 (11:16 +0200)
as it is used for arch:all packages as a map to arch:native.
Otherwise arch comparisons later will see differences (Closes: #689323)

apt-pkg/pkgcachegen.cc
debian/changelog

index 4eaf40b..739b538 100644 (file)
@@ -69,7 +69,9 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
       *Cache.HeaderP = pkgCache::Header();
       map_ptrloc const idxVerSysName = WriteStringInMap(_system->VS->Label);
       Cache.HeaderP->VerSysName = idxVerSysName;
-      map_ptrloc const idxArchitecture = WriteStringInMap(_config->Find("APT::Architecture"));
+      // this pointer is set in ReMap, but we need it now for WriteUniqString
+      Cache.StringItemP = (pkgCache::StringItem *)Map.Data();
+      map_ptrloc const idxArchitecture = WriteUniqString(_config->Find("APT::Architecture"));
       Cache.HeaderP->Architecture = idxArchitecture;
       if (unlikely(idxVerSysName == 0 || idxArchitecture == 0))
         return;
index 307bd1e..c1936a8 100644 (file)
@@ -8,6 +8,9 @@ apt (0.9.7.6) UNRELEASED; urgency=low
     - ensure that dependencies for packages:none are always generated
     - add 2 missing remap registrations causing a segfault in case
       we use the not remapped iterators after a move of the mmap again
+    - write the native architecture as unique string into the cache header
+      as it is used for arch:all packages as a map to arch:native.
+      Otherwise arch comparisons later will see differences (Closes: #689323)
   * apt-pkg/pkgcache.cc:
     - ignore negative dependencies applying in the same group for
       M-A:same packages on the real package name as self-conflicts