[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.42-69-g1159ca6

Andreas Beckmann debian at abeckmann.de
Thu May 17 11:45:59 UTC 2012


The following commit has been merged in the piatti branch:
commit 1adc18cdd62216c03064bcd0fb2fdb20eb22cfc4
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Tue Apr 17 23:00:29 2012 +0200

    only newest version is a candidate
    
    Packages files may contain several versions of the same package and
    are in unspecified ordering. This may happen especially for arch:all
    packages.
    Discard all duplicate package entries but the *newest* version while
    reading Packages files. (Up to now the *last* entry was used, but
    this is not neccessarily the installation candidate, i.e. the newest.)
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index a4f4abc..13fb08f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,9 @@ piuparts (0.44) UNRELEASED; urgency=low
     - Increase output limit to 3 MB (for dist-upgrading daptup).
     - Do not miss Pre-Depends in --warn-on-others mode.
     - Remove packages and reinstall missing ones in one apt-get call.
+  * piupartslib/packagesdb.py:
+    - Only consider the newest version of a package as test candidate.
+      (Packages files may contain more than version of the same package.)
   * piuparts-master.py:
     - Implement simple section locking to allow concurrent master instances
       but allow only one instance per section.
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index c704005..094eef0 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -28,10 +28,12 @@ import dircache
 import os
 import tempfile
 import UserDict
-
+import apt_pkg
 
 from piupartslib.dependencyparser import DependencyParser
 
+apt_pkg.init_system()
+
 
 def rfc822_like_header_parse(input):
     headers = []
@@ -134,6 +136,11 @@ class PackagesFile(UserDict.UserDict):
             if not headers:
                 break
             p = Package(headers)
+            if p["Package"] in self:
+                q = self[p["Package"]]
+                if apt_pkg.version_compare(p["Version"], q["Version"]) <= 0:
+                    # there is already a newer version
+                    continue
             self[p["Package"]] = p
 
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list