From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 0BF9F3858437; Mon, 28 Feb 2022 16:17:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BF9F3858437 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-31-gbf4b922 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 0c139f81907b572da7a87652ea414a089080b640 X-Git-Newrev: bf4b922115443862e35af20790ba5322f1c69daa Message-Id: <20220228161731.0BF9F3858437@sourceware.org> Date: Mon, 28 Feb 2022 16:17:30 +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: Mon, 28 Feb 2022 16:17:31 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=bf4b922115443862e35af20790ba5322f1c69daa commit bf4b922115443862e35af20790ba5322f1c69daa Author: Jon Turney Date: Sat Feb 26 12:51:33 2022 +0000 Move regex for detecting a soversion package to a single place Move the regex for detecting a soversion package to a single place, and adjust it slightly so it doesn't give a false positive on 'libfooN-devel', of which there are some instances. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=6ca03e06f2812fc24c0581ad1f8f651a4ab3be29 commit 6ca03e06f2812fc24c0581ad1f8f651a4ab3be29 Author: Jon Turney Date: Wed Feb 23 16:01:05 2022 +0000 Remove a long-unneeded irregularity in paths used on a test system https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=49600dd0855006dfce0f0c39bbd30700d4923d96 commit 49600dd0855006dfce0f0c39bbd30700d4923d96 Author: Jon Turney Date: Wed Feb 23 15:52:22 2022 +0000 Apply relaxed retention to all debuginfo packages https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=81a9a8ba42c499df5824aaad8faa590c1145f5c2 commit 81a9a8ba42c499df5824aaad8faa590c1145f5c2 Author: Jon Turney Date: Wed Feb 23 15:51:23 2022 +0000 By default, only produce reports when daemonized Diff: --- calm/calm.py | 6 +++++- calm/common_constants.py | 7 ++++++- calm/package.py | 12 ++---------- calm/reports.py | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/calm/calm.py b/calm/calm.py index 5d106e0..22eddaa 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -486,7 +486,7 @@ def do_output(args, state): pass # write reports - if update_json or args.force: + if (update_json or args.force) and args.reports: repology.annotate_packages(args, state.packages) reports.do_reports(args, state.packages) @@ -684,6 +684,7 @@ def main(): parser.add_argument('--setupdir', action='store', metavar='DIR', help="setup executable directory (default: " + setupdir_default + ")", default=setupdir_default) parser.add_argument('--no-stale', action='store_false', dest='stale', help="don't vault stale packages") parser.set_defaults(stale=True) + parser.add_argument('--reports', action='store_true', dest='reports', help="don't produce reports", default=None) parser.add_argument('-n', '--dry-run', action='store_true', dest='dryrun', help="don't do anything") parser.add_argument('--vault', action='store', metavar='DIR', help="vault directory (default: " + vault_default + ")", default=vault_default, dest='vault') parser.add_argument('-v', '--verbose', action='count', dest='verbose', help='verbose output') @@ -692,6 +693,9 @@ def main(): if args.email: args.email = args.email.split(',') + if args.reports is None: + args.reports = args.daemon + state = CalmState() host = os.uname()[1] diff --git a/calm/common_constants.py b/calm/common_constants.py index 05473f5..bc99805 100644 --- a/calm/common_constants.py +++ b/calm/common_constants.py @@ -77,7 +77,6 @@ DEFAULT_KEEP_DAYS = 0 # different values to be used when we are not running on sourceware.org, but my # test system... if os.uname()[1] == 'tambora': - FTP = '/var/ftp/pub/cygwin-test' EMAILS = 'jon.turney@dronecode.org.uk' ALWAYS_BCC = '' MAILHOST = 'allegra' @@ -85,3 +84,9 @@ if os.uname()[1] == 'tambora': # package compressions PACKAGE_COMPRESSIONS = ['bz2', 'gz', 'lzma', 'xz', 'zst'] PACKAGE_COMPRESSIONS_RE = r'\.(' + '|'.join(PACKAGE_COMPRESSIONS) + r')' + +# ideally we'd identify soversion packages via some explicit mark, or by +# inspecting the contents (but that's expensive to do). for the moment, we +# recognize soversion packages by the simple heuristic of looking at the package +# name +SOVERSION_PACKAGE_RE = r'^lib.*[\d_.]*$' diff --git a/calm/package.py b/calm/package.py index 6d9901b..8c6a3f1 100755 --- a/calm/package.py +++ b/calm/package.py @@ -820,7 +820,7 @@ def validate_packages(args, packages, valid_requires_extra=None): # ignore runtime library packages, as we may keep old versions of # those - if re.match(r'^lib.*\d', install_p): + if re.match(common_constants.SOVERSION_PACKAGE_RE, install_p): continue # ignore Python module packages, as we may keep old versions of @@ -1345,15 +1345,7 @@ def stale_packages(packages): # time?), or obsoleted packages(?) mark = Freshness.fresh if pn.endswith('-debuginfo'): - # XXX: initially only apply to sourceless debuginfo packages (which - # must also be empty to be permitted to sourceless) - for v in po.versions(): - if po.tar(v).sourceless: - mark = Freshness.conditional - break - # XXX: initially only apply to obsolete packages - if po.obsolete: - mark = Freshness.conditional + mark = Freshness.conditional # mark any versions explicitly listed in the keep: override hint (unconditionally) for v in po.override_hints.get('keep', '').split(): diff --git a/calm/reports.py b/calm/reports.py index 834371c..270e872 100644 --- a/calm/reports.py +++ b/calm/reports.py @@ -27,6 +27,7 @@ import re import textwrap import types +from . import common_constants from . import maintainers from . import package from . import pkg2html @@ -141,7 +142,7 @@ def deprecated(args, packages, reportsdir): if po.kind != package.Kind.binary: continue - if not re.match(r'^lib.*\d', p): + if not re.match(common_constants.SOVERSION_PACKAGE_RE, p): continue bv = po.best_version