From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 4D7C73858D1E; Tue, 2 May 2023 14:19:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D7C73858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683037152; bh=MjD0cjyROeOAnAnLDjoV0Bjcu7of6ZI9bxOxFx6j95A=; h=To:Subject:Date:From:From; b=D2z25Gk2YQ6vMSINBL/09mcon0VfTqzEtvdx3YI4eK/faA0UuMetsLVlka7iTTvo1 XCcV2124hYSjfVBk7ctwc+dl9LRqsPVb1UdYoR0QgA05loz3c3NnjUJ7KI94yDtU3d ZPuM2c6E6r4MNIM4h/Ju9hxu6kapq/gtTzKyvFBQ= To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-25-gdf6c091 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1b1dcdc3905defa775445f53d906c0ff31da2078 X-Git-Newrev: df6c091c36d3406796f9c20f2386f59e4ab70518 Message-Id: <20230502141912.4D7C73858D1E@sourceware.org> Date: Tue, 2 May 2023 14:19:12 +0000 (GMT) From: Jon Turney List-Id: https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=df6c091c36d3406796f9c20f2386f59e4ab70518 commit df6c091c36d3406796f9c20f2386f59e4ab70518 Author: Jon Turney Date: Sun Apr 30 16:04:11 2023 +0100 Use regex matching for version provides: This makes out-of-order uploading of users and providers of future versions of these smoother. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=5fc54135fc49a4dd7718bfb76ea9733b0d1cee31 commit 5fc54135fc49a4dd7718bfb76ea9733b0d1cee31 Author: Jon Turney Date: Thu Apr 27 20:11:52 2023 +0100 Add a ruby rebuilds report Generalize the perl rebuild report logic to work for any version provide: Diff: --- calm/package.py | 2 +- calm/past_mistakes.py | 26 ++++++++++------ calm/reports.py | 50 +++++++++++++++--------------- test/testdata/process_arch/htdocs.expected | 2 +- 4 files changed, 44 insertions(+), 36 deletions(-) diff --git a/calm/package.py b/calm/package.py index 9bcaf04..f60c238 100755 --- a/calm/package.py +++ b/calm/package.py @@ -729,7 +729,7 @@ def validate_packages(args, packages, valid_provides_extra=None, missing_obsolet # all packages listed in a hint must exist (unless the # disable-check option says that's ok) - if (r not in valid) and (r not in past_mistakes.nonexistent_provides + past_mistakes.expired_provides): + if (r not in valid) and (r not in past_mistakes.expired_provides) and (not any(re.match(nep, r) for nep in past_mistakes.nonexistent_provides)): if okmissing not in getattr(args, 'disable_check', []): logging.error("package '%s' version '%s' %s: '%s', but nothing satisfies that" % (p, v, c, r)) error = True diff --git a/calm/past_mistakes.py b/calm/past_mistakes.py index e1b90e1..b09fa00 100644 --- a/calm/past_mistakes.py +++ b/calm/past_mistakes.py @@ -152,19 +152,27 @@ missing_obsolete = { 'xfig-debuginfo': ['transfig-debuginfo'], # contain conflicting files } -# provides: which don't exist -nonexistent_provides = [ - '_windows', - 'perl5_026', +# historical provides +# +# something obsoletes these, but they were removed before we started remembering +# all historic_package_names +historical_provides = [ 'rdiff-debuginfo', 'rxvt-unicode-X-debuginfo', 'xfce4-mixer-debuginfo', 'python3-dbus-debuginfo', - 'tl_2023', - 'tl_basic_2023', - 'ruby_23', - 'ruby_22', - 'ruby_20', +] + +# provides: which don't exist +# +# we use regex patterns to match version provides which might have been expired, +# or not uploaded yet. +nonexistent_provides = historical_provides + [ + '_windows', + r'perl5_\d+', + r'ruby_\d+', + r'tl_\d+', + r'tl_basic_\d+', ] # provides: which don't exist and packages which require them should be expired diff --git a/calm/reports.py b/calm/reports.py index f5405ae..1773840 100644 --- a/calm/reports.py +++ b/calm/reports.py @@ -205,31 +205,31 @@ def provides_rebuild(args, packages, reportfile, provide_package): pp_provide = pp_package.version_hints[pp_bv]['provides'] pp_provide_base = re.sub(r'\d+$', '', pp_provide) - for p in packages[arch]: - po = packages[arch][p] - bv = po.best_version - - depends = packages[arch][p].version_hints[bv]['depends'].split(', ') - depends = [re.sub(r'(.*) +\(.*\)', r'\1', r) for r in depends] - - for d in depends: - if not d.startswith(pp_provide_base): - continue - - if d == pp_provide: - continue - - # requires an old provide - pr = types.SimpleNamespace() - pr.pn = p - pr.po = po - pr.spn = po.srcpackage(bv) - pr.spo = packages[arch][pr.spn] - pr.depends = d - pr.bv = bv - - pr_list.append(pr) - break + for p in packages[arch]: + po = packages[arch][p] + bv = po.best_version + + depends = packages[arch][p].version_hints[bv]['depends'].split(', ') + depends = [re.sub(r'(.*) +\(.*\)', r'\1', r) for r in depends] + + for d in depends: + if not d.startswith(pp_provide_base): + continue + + if d == pp_provide: + continue + + # requires an old provide + pr = types.SimpleNamespace() + pr.pn = p + pr.po = po + pr.spn = po.srcpackage(bv) + pr.spo = packages[arch][pr.spn] + pr.depends = d + pr.bv = bv + + pr_list.append(pr) + break body = io.StringIO() print('

Packages whose latest version depends on a version provides: other than %s.

' % pp_provide, file=body) diff --git a/test/testdata/process_arch/htdocs.expected b/test/testdata/process_arch/htdocs.expected index 46d9d7e..55585d6 100644 --- a/test/testdata/process_arch/htdocs.expected +++ b/test/testdata/process_arch/htdocs.expected @@ -1,5 +1,5 @@ {'.': ['calm.db', 'packages.inc', 'src_packages.inc'], - 'reports': ['deprecated_so.html', 'perl_rebuilds.html', 'unmaintained.html'], + 'reports': ['deprecated_so.html', 'perl_rebuilds.html', 'ruby_rebuilds.html', 'unmaintained.html'], 'summary': ['arc-src.html', 'arc.html', 'base-cygwin.html',