[Piuparts-commits] [piuparts] 04/12: lib/db: use the actual package versions for resolving the "outdated" state

Holger Levsen holger at layer-acht.org
Wed Oct 11 14:58:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 80bb5e4338fc995712c0caccde64bfdbe38d2ca4
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Oct 7 23:03:24 2017 +0200

    lib/db: use the actual package versions for resolving the "outdated" state
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog          | 1 +
 piupartslib/packagesdb.py | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ce2e7d3..13def9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ piuparts (0.83) UNRELEASED; urgency=medium
     - Add new package data accessors name(), version(), test_versions().
     - Use test_versions() in all places referring to a piuparts test.
     - Set test_versions while loading versions from the final target distro.
+    - Use the actual package versions for resolving the "outdated" state.
 
  -- Holger Levsen <holger at debian.org>  Sat, 07 Oct 2017 17:42:12 +0200
 
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index b011193..d9fcb14 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -462,9 +462,12 @@ class PackagesDB:
     def _lookup_package_state(self, package, use_cached_success, check_outdated):
         if check_outdated:
             # Check if dependency databases have a newer version of this package.
+            # Use the actual package versions, not the target versions.
+            curr_ver = package.version()
             for db in self._dependency_databases:
-                v = db.get_version(package["Package"])
-                if v is not None and apt_pkg.version_compare(package["Version"], v) < 0:
+                dep_ver = db.get_version(package.name())
+                if dep_ver is not None and apt_pkg.version_compare(curr_ver, dep_ver) < 0:
+                    #logging.info("[%s] outdated: %s %s < %s @[%s]" % (self.prefix, package.name(), curr_ver, dep_ver, db.prefix))
                     return "outdated";
         if self._recycle_mode and self._logdb.log_exists(package, [self._recycle]):
             return "unknown"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list