From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 2FAA038293F3; Sun, 29 May 2022 22:07:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FAA038293F3 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-45-g51b7563 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 6ef8bdef5f8f9dd76dec89150d0845521fa04b96 X-Git-Newrev: 51b7563055729cf836da85ccac7d731583c26392 Message-Id: <20220529220726.2FAA038293F3@sourceware.org> Date: Sun, 29 May 2022 22:07:25 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2022 22:07:26 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=51b7563055729cf836da85ccac7d731583c26392 commit 51b7563055729cf836da85ccac7d731583c26392 Author: Jon Turney 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():