From df6c091c36d3406796f9c20f2386f59e4ab70518 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 30 Apr 2023 16:04:11 +0100 Subject: Use regex matching for version provides: This makes out-of-order uploading of users and providers of future versions of these smoother. --- calm/package.py | 2 +- calm/past_mistakes.py | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 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 -- cgit v1.2.3