[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210408-1-g74f9536

Jon TURNEY via Cygwin-apps-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs.apps
Message-ID <[email protected]>


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

commit 74f9536819ef4a4116e710d35b452b7f78e21247
Author: Jon Turney <[email protected]>
Date:   Tue Mar 16 13:17:46 2021 +0000

    Update perl annotation tool
    
    The default perl annotation is now 5_032.
    
    Use 5_26 annotation.  This makes existing packages which depend on perl
    5.26 uninstallable, as nothing provides: perl5_026.


Diff:
---
 calm/fix-annotate-perl-hint.py | 17 +++++++++++++----
 calm/package.py                |  2 +-
 calm/past_mistakes.py          |  5 +++++
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/calm/fix-annotate-perl-hint.py b/calm/fix-annotate-perl-hint.py
index 41ab770..126dd51 100644
--- a/calm/fix-annotate-perl-hint.py
+++ b/calm/fix-annotate-perl-hint.py
@@ -63,17 +63,26 @@ def fix_one_hint(dirpath, hintfile, tf):
 
     modified = False
 
-    # if no annotation yet, add a perl annotation
+    # if no annotation yet ...
     if 'notes' not in hints:
         requires = hints.get('requires', '').split()
         if requires:
+            # is a perl provide is already present in requires?
+            if any(r.startswith('perl5_') for r in requires):
+                return
+
+            # ... otherwise, add a perl annotation
             if ('perl_base' in requires) or ('perl' in requires):
                 logging.info("%s has perl in requires and no annotations" % (hintfile))
-                hints['notes'] = 'perl5_030'
+                hints['notes'] = 'perl5_032'
                 modified = True
 
+    # fix spelling mistake in 5_26 annotation
+    if hints.get('notes', '') == 'perl5_26':
+        hints['notes'] = 'perl5_026'
+
     # if annotated, check if this package installs into vendor_perl, and if so,
-    # add the annotate perl version to requires, if not already present
+    # add the annotated perl version to requires, if not already present
     if hints.get('notes', '').startswith('perl5_0'):
         ivp = False
         exe = False
@@ -93,7 +102,7 @@ def fix_one_hint(dirpath, hintfile, tf):
                 requires.append(hints['notes'])
                 requires = sorted(requires)
                 modified = True
-                logging.warning("adding perl provide to requires in %s" % (hintfile))
+                logging.warning("adding %s to requires in %s" % (hints['notes'], hintfile))
             hints['requires'] = ' '.join(requires)
         else:
             if exe:
diff --git a/calm/package.py b/calm/package.py
index b28907a..ea41b1f 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -525,7 +525,7 @@ def validate_packages(args, packages):
 
                         # all packages listed in a hint must exist (unless the
                         # disable-check option says that's ok)
-                        if r not in valid_requires:
+                        if (r not in valid_requires) and (r not 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 627411b..d8f2084 100644
--- a/calm/past_mistakes.py
+++ b/calm/past_mistakes.py
@@ -190,3 +190,8 @@ maint_anomalies = {
     'python-debuginfo': ['2.7.12-1'],  # should be obsoleted by python2(-debuginfo)
     'transfig-debuginfo': ['3.2.5e-2'],  # should be obsoleted by xfig(-debuginfo)
 }
+
+# provides: which don't exist
+nonexistent_provides = [
+    'perl5_026',
+]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.