Sfoglia il codice sorgente

libdpkg: Always ignore older versions when parsing the available file

To be able to get a proper candidate for dselect the latest version
from the available file should always be selected, regardless of who
is loading the file.
Guillem Jover 14 anni fa
parent
commit
4e77471900
2 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 2 0
      debian/changelog
  2. 1 1
      lib/dpkg/parse.c

+ 2 - 0
debian/changelog

@@ -69,6 +69,8 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     and --show, add a new --load-avail option to expose the old behaviour.
     and --show, add a new --load-avail option to expose the old behaviour.
   * Only allow setting selections via «dpkg --set-selections» for known
   * Only allow setting selections via «dpkg --set-selections» for known
     packages (i.e. those present in either the status or available files).
     packages (i.e. those present in either the status or available files).
+  * Always ignore older versions when parsing the available file, not only
+    for --update-avail and --merge-avail.
 
 
   [ Raphaël Hertzog ]
   [ Raphaël Hertzog ]
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building

+ 1 - 1
lib/dpkg/parse.c

@@ -591,7 +591,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
     else
     else
       db_pkgbin = &db_pkg->installed;
       db_pkgbin = &db_pkg->installed;
 
 
-    if ((flags & pdb_ignoreolder) &&
+    if (((flags & pdb_ignoreolder) || ps.type == pdb_file_available) &&
         versioncompare(&new_pkgbin->version, &db_pkgbin->version) < 0)
         versioncompare(&new_pkgbin->version, &db_pkgbin->version) < 0)
       continue;
       continue;