public inbox for cygwin-apps-cvs@sourceware.org help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org> To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-11-g3282d5c Date: Sat, 29 Jan 2022 14:55:12 +0000 (GMT) [thread overview] Message-ID: <20220129145512.7F59F3858D28@sourceware.org> (raw) 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)
reply other threads:[~2022-01-29 14:55 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220129145512.7F59F3858D28@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-apps-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).