pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/python-versions-check



Module Name:    pkgsrc
Committed By:   wiz
Date:           Mon Jul  3 17:40:11 UTC 2023

Modified Files:
        pkgsrc/pkgtools/python-versions-check: Makefile
        pkgsrc/pkgtools/python-versions-check/files: python-versions-check

Log Message:
python-versions-check: use issuperset() instead of '>'

Add debugging output.

Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/python-versions-check/Makefile
cvs rdiff -u -r1.3 -r1.4 \
    pkgsrc/pkgtools/python-versions-check/files/python-versions-check

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/python-versions-check/Makefile
diff -u pkgsrc/pkgtools/python-versions-check/Makefile:1.3 pkgsrc/pkgtools/python-versions-check/Makefile:1.4
--- pkgsrc/pkgtools/python-versions-check/Makefile:1.3  Sat Jul  1 13:16:52 2023
+++ pkgsrc/pkgtools/python-versions-check/Makefile      Mon Jul  3 17:40:11 2023
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2023/07/01 13:16:52 wiz Exp $
+# $NetBSD: Makefile,v 1.4 2023/07/03 17:40:11 wiz Exp $
 
-PKGNAME=               python-versions-check-1.2
+PKGNAME=               python-versions-check-1.3
 CATEGORIES=            pkgtools
 
 MAINTAINER=            wiz%NetBSD.org@localhost

Index: pkgsrc/pkgtools/python-versions-check/files/python-versions-check
diff -u pkgsrc/pkgtools/python-versions-check/files/python-versions-check:1.3 pkgsrc/pkgtools/python-versions-check/files/python-versions-check:1.4
--- pkgsrc/pkgtools/python-versions-check/files/python-versions-check:1.3       Sat Jul  1 13:16:52 2023
+++ pkgsrc/pkgtools/python-versions-check/files/python-versions-check   Mon Jul  3 17:40:11 2023
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# $NetBSD: python-versions-check,v 1.3 2023/07/01 13:16:52 wiz Exp $
+# $NetBSD: python-versions-check,v 1.4 2023/07/03 17:40:11 wiz Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -127,6 +127,8 @@ def extract_includes(path, dict_key=None
                 python_versions[dict_key] = supported_versions(dict_key) - set(m.group(1).split())
     if not any_python_include:
         includes[dict_key] = set([])
+    if args.debug:
+        print(f"DEBUG: result {path} (for {dict_key}) supports {python_versions[dict_key]}")
     return includes[dict_key]
 
 
@@ -150,12 +152,12 @@ def get_pkg_path(full_path):
     return cand
 
 
-def report_problem(first, first_versions, second_versions):
+def report_problem(first, supports, superset, subset):
     '''Pretty-print a problem with mismatching Python versions.'''
-    difference = first_versions ^ second_versions
+    difference = superset - subset
     difference = sorted([int(x) for x in difference])
-    first_versions = sorted([int(x) for x in first_versions])
-    print(f'{first}: supports {first_versions}, missing: {difference}')
+    supports = sorted([int(x) for x in supports])
+    print(f'{first}: supports {supports}, missing: {difference}')
 
 
 if 'PKGSRCDIR' in os.environ:
@@ -208,9 +210,10 @@ print(f"Supported Python versions for {a
 print(f"Checking packages used by {args.package}:")
 for entry in result:
     entry_versions = supported_versions(entry)
-    # print(f"python version for {entry}: {entry_versions}")
-    if supported_versions(args.package) > entry_versions:
-        report_problem(entry, entry_versions, supported_versions(args.package))
+    if args.debug:
+        print(f"DEBUG: comparing to {entry} - supports {entry_versions}")
+    if not entry_versions.issuperset(supported_versions(args.package)):
+        report_problem(entry, entry_versions, entry_versions, supported_versions(args.package))
 
 makefiles = glob.glob(args.pkgsrcdir + '/*/*/Makefile*')
 makefiles.extend(glob.glob(args.pkgsrcdir + '/*/*/*.mk'))
@@ -241,6 +244,6 @@ while searchlist:
         if entry in dependencies:
             package_versions = supported_versions(package)
             if entry_versions < package_versions:
-                report_problem(package, package_versions, entry_versions)
+                report_problem(package, package_versions, package_versions, entry_versions)
                 python_versions[package] = entry_versions
                 searchlist.add(package)



Home | Main Index | Thread Index | Old Index