- Loosen the version check in cache generation filelist merging stage to
authorPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Tue, 6 Mar 2007 20:19:47 +0000 (22:19 +0200)
committerPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Tue, 6 Mar 2007 20:19:47 +0000 (22:19 +0200)
  only check for version-arch instead of full versionhash. Repomd filelists.xml
  doesn't carry full dependency info so versionhash from filelists would
  give bogus mismatches for everything.

apt-pkg/pkgcachegen.cc

index 13f27fc..1dbd7bf 100644 (file)
@@ -284,12 +284,14 @@ bool pkgCacheGenerator::MergeFileProvides(ListParser &List)
            Progress->Progress(Counter);
       }
 
-      unsigned long Hash = List.VersionHash();
+      string Arch = List.Architecture();
       pkgCache::VerIterator Ver = Pkg.VersionList();
       for (; Ver.end() == false; Ver++)
       {
-        // CNC:2002-07-25
-        if (Ver->Hash == Hash && strcmp(Version.c_str(), Ver.VerStr()) == 0)
+        // We'd want to check against versionhash but repomd filelists
+        // don't carry all the necessary data. Settle for ver-arch match.
+        if (strcmp(Version.c_str(), Ver.VerStr()) == 0 &&
+            strcmp(Arch.c_str(), Ver.Arch()) == 0)
         {
            if (List.CollectFileProvides(Cache,Ver) == false)
               return _error->Error(_("Error occured while processing %s (CollectFileProvides)"),PackageName.c_str());