[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-104-g1374472

Jon Turney jturney@sourceware.org
Thu Apr 25 14:07:34 GMT 2024




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

commit 1374472295d04be7b10bdc692db0f0d69b833447
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Apr 24 13:20:39 2024 +0100

    Clarify missing obsoletes reminder
    
    Make it clearer that if calm has to provide missing obsoletes, that is a
    packaging defect.

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

commit e1c2bc5d588edf197a18495578ba251ccef51e9f
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Jun 19 13:11:44 2022 +0100

    Don't retain obsolete packages
    
    Don't retain obsolete packages over a certain age threshold (when they
    are effectively just adding an obsolete: to another package).
    
    This is safe, as commit 17dc61e9 (persisting missing_obsoletes) ensures
    that if the obsoletion was old-style (and thus only recorded in the
    obsoleted package, with the new-style obsoletes: hint in the obsoleteing
    package being synthesized by commit eca3a88d), the fact of that
    obsoletion isn't forgotten once the obsolete package itself is removed.

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

commit 4ebc8832703ad5578b99690256d48089f319d3da
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Feb 23 23:39:23 2022 +0000

    Misspellings re-uploaded since last fixed


Diff:
---
 calm/hint.py    |  2 ++
 calm/package.py | 20 ++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/calm/hint.py b/calm/hint.py
index 680e3f7..7e9f66b 100755
--- a/calm/hint.py
+++ b/calm/hint.py
@@ -401,6 +401,8 @@ words = [
     (' examing ', ' examining '),
     (' extremly ', ' extremely '),
     (' interm ', ' interim '),
+    (' immitation ', ' imitation '),
+    (' nlike ', ' Unlike '),
     (' procesors ', ' processors '),
     (' utilitzed ', ' utilized '),
     (' utilties ', ' utilities '),
diff --git a/calm/package.py b/calm/package.py
index 64587e5..712f9b5 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -834,6 +834,7 @@ def validate_packages(args, packages, valid_provides_extra=None, missing_obsolet
                                 obsoletes.append(n)
                                 packages[p].version_hints[v]['obsoletes'] = obsoletes
                                 logging.info("added 'obsoletes: %s' to package '%s' version '%s'" % (n, p, v))
+                                logging.info("this should be in fixed in the cygport packaging")
 
                             # recurse so we don't drop transitive missing obsoletes
                             if n in mo:
@@ -1648,7 +1649,7 @@ def mark_package_fresh(packages, p, v, mark=Freshness.fresh):
 # helper function evaluate if package needs marking for conditional retention
 #
 
-def mark_fn(packages, po, v, certain_age, vault_requests):
+def mark_fn(packages, po, v, certain_age, obs_threshold, vault_requests):
     pn = po.name
     bv = po.best_version
 
@@ -1676,6 +1677,17 @@ def mark_fn(packages, po, v, certain_age, vault_requests):
                 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, True)
 
+    # - package is an old-style obsoletion, over a certain age, and not marked
+    # as self-destruct
+    #
+    if '_obsolete' in po.version_hints[v]['category']:
+        mtime = po.tar(v).mtime
+        if mtime < obs_threshold:
+            provides = po.version_hints[v].get('provides', [])
+            if '_self-destruct' not in provides:
+                logging.debug("obsolete package '%s' version '%s' mtime '%s' is over cut-off age" % (pn, v, time.strftime("%F %T %Z", time.localtime(mtime))))
+                return (Freshness.conditional, False)
+
     # - if package depends on anything in expired_provides
     #
     requires = po.version_hints[v].get('depends', [])
@@ -1700,12 +1712,16 @@ def mark_fn(packages, po, v, certain_age, vault_requests):
 #
 
 SO_AGE_THRESHOLD_YEARS = 5
+OBSOLETE_AGE_THRESHOLD_YEARS = 10
 
 
 def stale_packages(packages, vault_requests):
     certain_age = time.time() - (SO_AGE_THRESHOLD_YEARS * 365.25 * 24 * 60 * 60)
     logging.debug("cut-off date for soversion package to be considered old is %s" % (time.strftime("%F %T %Z", time.localtime(certain_age))))
 
+    obs_threshold = time.time() - (OBSOLETE_AGE_THRESHOLD_YEARS * 365.25 * 24 * 60 * 60)
+    logging.debug("cut-off date for obsolete package to be considered old is %s" % (time.strftime("%F %T %Z", time.localtime(obs_threshold))))
+
     # mark install packages for freshness
     for pn, po in packages.items():
         # mark as fresh any versions explicitly listed in the keep: override
@@ -1763,7 +1779,7 @@ def stale_packages(packages, vault_requests):
         # overwrite with 'conditional' package retention mark if it meets
         # various criteria
         for v in sorted(po.versions(), key=lambda v: SetupVersion(v)):
-            (mark, others) = mark_fn(packages, po, v, certain_age, vault_requests)
+            (mark, others) = mark_fn(packages, po, v, certain_age, obs_threshold, vault_requests)
             if mark != Freshness.fresh:
                 mark_package_fresh(packages, pn, v, mark)
 



More information about the Cygwin-apps-cvs mailing list