[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-45-g51b7563

Jon TURNEY jturney@sourceware.org
Sun May 29 22:07:25 GMT 2022




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=51b7563055729cf836da85ccac7d731583c26392

commit 51b7563055729cf836da85ccac7d731583c26392
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Tue May 24 17:40:14 2022 +0100

    Improve deprecated soversion expiry
    
    Apply the age criterion to the mtime of the version under consideration,
    not of best_version (probably the newest version).


Diff:
---
 calm/package.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index 2f318b2..0b3dec8 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -1348,6 +1348,9 @@ class Freshness(IntEnum):
 
 
 def mark_package_fresh(packages, p, v, mark=Freshness.fresh):
+    if callable(mark):
+        mark = mark(v)
+
     packages[p].tar(v).fresh = mark
 
 
@@ -1384,10 +1387,16 @@ def stale_packages(packages):
         if (len(po.rdepends) == 0) and re.match(common_constants.SOVERSION_PACKAGE_RE, pn):
             bv = po.best_version
             es = po.version_hints[bv].get('external-source', None)
-            mtime = po.tar(bv).mtime
-            if es and (packages[es].best_version != bv) and (mtime < certain_age):
-                logging.debug("deprecated soversion package '%s' mtime '%s' is over cut-off age" % (pn, time.strftime("%F %T %Z", time.localtime(mtime))))
-                mark = Freshness.conditional
+            if es and (packages[es].best_version != bv):
+                def dep_so_age_mark(v):
+                    mtime = po.tar(v).mtime
+                    if mtime < certain_age:
+                        logging.debug("deprecated soversion package '%s' version '%s' mtime '%s' is over cut-off age" % (pn, v, time.strftime("%F %T %Z", time.localtime(mtime))))
+                        return Freshness.conditional
+                    else:
+                        return Freshness.fresh
+
+                mark = dep_so_age_mark
 
         # mark any versions explicitly listed in the keep: override hint (unconditionally)
         for v in po.override_hints.get('keep', '').split():



More information about the Cygwin-apps-cvs mailing list