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




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

commit 3282d5c98e7bbad81abe17bdf42507f330c35caf
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Nov 29 18:43:58 2021 +0000

    Expire superseded test versions
    
    Expire superseded test versions (that is: expire test versions where a
    non-test version with a higher version number exists), unless disabled by
    the 'keep-superseded-test' hint.
    
    (For this to work as expected, don't unconditionally mark the version
    assigned to the test: stability level as not to be expired, so it can be
    expired if superseded).


Diff:
---
 TODO            | 1 -
 calm/hint.py    | 1 +
 calm/package.py | 8 +++++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/TODO b/TODO
index 534080c..c7c6f26 100644
--- a/TODO
+++ b/TODO
@@ -11,4 +11,3 @@
 * report changes in override.hint like we used to for setup.hint
 * maintainers.py should only re-read cygwin-pkg-maint if it's changed
 * empty install packages should only come in two variants: no dependencies and in _obsolete category, or with dependencies and in 'meta' category
-* expire test versions superseded by a non-test version (unless keep-superseded-test: in override.hint?)
diff --git a/calm/hint.py b/calm/hint.py
index dc5efe8..15c468f 100755
--- a/calm/hint.py
+++ b/calm/hint.py
@@ -74,6 +74,7 @@ hintkeys[override] = {
     'keep-count': 'val',
     'keep-count-test': 'val',
     'keep-days': 'val',
+    'keep-superseded-versions': 'noval',
     'disable-check': 'val',
     'replace-versions': 'val',
 }
diff --git a/calm/package.py b/calm/package.py
index 4ec906f..947d06b 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -1340,7 +1340,7 @@ def mark_package_fresh(packages, p, v):
 def stale_packages(packages):
     for pn, po in packages.items():
         # mark any versions used by stability levels as fresh
-        for level in ['curr', 'prev', 'test']:
+        for level in ['curr', 'prev']:
             if level in po.stability:
                 v = po.stability[level]
                 mark_package_fresh(packages, pn, v)
@@ -1364,6 +1364,9 @@ def stale_packages(packages):
 
         # mark as fresh the highest n test versions, where n is given by the
         # keep-count-test: override hint, (defaulting to DEFAULT_KEEP_COUNT_TEST)
+        #
+        # only consider versions not superseded by non-test versions (unless
+        # 'keep-superseded-test' is present).
         keep_count = int(po.override_hints.get('keep-count-test', common_constants.DEFAULT_KEEP_COUNT_TEST))
         for v in sorted(po.versions(), key=lambda v: SetupVersion(v), reverse=True):
             if 'test' in po.version_hints[v]:
@@ -1371,6 +1374,9 @@ def stale_packages(packages):
                     break
                 mark_package_fresh(packages, pn, v)
                 keep_count = keep_count - 1
+            else:
+                if 'keep-superseded-test' not in po.override_hints:
+                    break
 
         # mark as fresh all versions after the first one which is newer than
         # the keep-days: override hint, (defaulting to DEFAULT_KEEP_DAYS)



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

only message in thread, other threads:[~2022-01-29 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 14:55 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-11-g3282d5c 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).