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-31-gbf4b922
Date: Mon, 28 Feb 2022 16:17:30 +0000 (GMT)	[thread overview]
Message-ID: <20220228161731.0BF9F3858437@sourceware.org> (raw)




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

commit bf4b922115443862e35af20790ba5322f1c69daa
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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



                 reply	other threads:[~2022-02-28 16:17 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=20220228161731.0BF9F3858437@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: link
Be 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).