[Piuparts-commits] [piuparts] 04/09: lib/db: order logs by time waiting for recycling

Holger Levsen holger at moszumanska.debian.org
Mon Feb 10 13:03:04 UTC 2014


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

holger pushed a commit to branch develop
in repository piuparts.

commit dd1af6214f4dfce1600addb6a031da1c962f3db5
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Feb 10 02:50:55 2014 +0100

    lib/db: order logs by time waiting for recycling
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog          | 1 +
 piupartslib/packagesdb.py | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 93779a2..04df2bb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,7 @@ piuparts (0.57) UNRELEASED; urgency=low
       failed. Used for dependency resolution.
     - No longer special-case packages as essential-required and test them like
       normal packages (no-op test plus adequate run).  (Closes: #735907)
+    - Improve ordering of packages to be tested/recycled.
   * piuparts-master-backend.py:
     - Improve master.log verbosity.
   * piuparts-report.py:
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 68b8446..7861bbc 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -703,10 +703,17 @@ class PackagesDB:
                     waiting_count,
                     )
 
+        try:
+            statobj = self._logdb.stat(self._recycle, p["Package"], p["Version"])
+            stamp = statobj[stat.ST_CTIME]  # last inode modification = time of linking into recycle/
+        except OSError:
+            stamp = 0
+
         return (
                 min(rdep_chain_len, waiting_count),
                 waiting_count,
                 not self._logdb.log_exists(p, [self._ok]),  # prefer problematic logs
+                -stamp,  # prefer older
                 )
 
     def _find_packages_ready_for_testing(self):

-- 
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