public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-45-g51b7563
@ 2022-05-29 22:07 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-05-29 22:07 UTC (permalink / raw)
  To: cygwin-apps-cvs




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():



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-29 22:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-29 22:07 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-45-g51b7563 Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).