| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!/usr/bin/env python3 | | 1 | #!/usr/bin/env python3 |
2 | # | | 2 | # |
3 | # $NetBSD: python-versions-check,v 1.4 2023/07/03 17:40:11 wiz Exp $ | | 3 | # $NetBSD: python-versions-check,v 1.5 2023/07/03 20:58:48 wiz Exp $ |
4 | # | | 4 | # |
5 | # Copyright (c) 2023 The NetBSD Foundation, Inc. | | 5 | # Copyright (c) 2023 The NetBSD Foundation, Inc. |
6 | # All rights reserved. | | 6 | # All rights reserved. |
7 | # | | 7 | # |
8 | # This code is derived from software contributed to The NetBSD Foundation | | 8 | # This code is derived from software contributed to The NetBSD Foundation |
9 | # by Thomas Klausner. | | 9 | # by Thomas Klausner. |
10 | # | | 10 | # |
11 | # Redistribution and use in source and binary forms, with or without | | 11 | # Redistribution and use in source and binary forms, with or without |
12 | # modification, are permitted provided that the following conditions | | 12 | # modification, are permitted provided that the following conditions |
13 | # are met: | | 13 | # are met: |
14 | # 1. Redistributions of source code must retain the above copyright | | 14 | # 1. Redistributions of source code must retain the above copyright |
15 | # notice, this list of conditions and the following disclaimer. | | 15 | # notice, this list of conditions and the following disclaimer. |
16 | # 2. Redistributions in binary form must reproduce the above copyright | | 16 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -203,27 +203,27 @@ while searchlist: | | | @@ -203,27 +203,27 @@ while searchlist: |
203 | if entry in result: | | 203 | if entry in result: |
204 | continue | | 204 | continue |
205 | result.add(entry) | | 205 | result.add(entry) |
206 | searchlist |= extract_includes(args.pkgsrcdir + '/' + entry + '/Makefile') | | 206 | searchlist |= extract_includes(args.pkgsrcdir + '/' + entry + '/Makefile') |
207 | | | 207 | |
208 | # print(f"dependencies for {args.package}: {sorted(result)}") | | 208 | # print(f"dependencies for {args.package}: {sorted(result)}") |
209 | print(f"Supported Python versions for {args.package}: {sorted([int(x) for x in supported_versions(args.package)])}") | | 209 | print(f"Supported Python versions for {args.package}: {sorted([int(x) for x in supported_versions(args.package)])}") |
210 | print(f"Checking packages used by {args.package}:") | | 210 | print(f"Checking packages used by {args.package}:") |
211 | for entry in result: | | 211 | for entry in result: |
212 | entry_versions = supported_versions(entry) | | 212 | entry_versions = supported_versions(entry) |
213 | if args.debug: | | 213 | if args.debug: |
214 | print(f"DEBUG: comparing to {entry} - supports {entry_versions}") | | 214 | print(f"DEBUG: comparing to {entry} - supports {entry_versions}") |
215 | if not entry_versions.issuperset(supported_versions(args.package)): | | 215 | if not entry_versions.issuperset(supported_versions(args.package)): |
216 | report_problem(entry, entry_versions, entry_versions, supported_versions(args.package)) | | 216 | report_problem(entry, entry_versions, supported_versions(args.package), entry_versions) |
217 | | | 217 | |
218 | makefiles = glob.glob(args.pkgsrcdir + '/*/*/Makefile*') | | 218 | makefiles = glob.glob(args.pkgsrcdir + '/*/*/Makefile*') |
219 | makefiles.extend(glob.glob(args.pkgsrcdir + '/*/*/*.mk')) | | 219 | makefiles.extend(glob.glob(args.pkgsrcdir + '/*/*/*.mk')) |
220 | makefiles = list(filter(lambda name: name.find('/mk/') == -1 | | 220 | makefiles = list(filter(lambda name: name.find('/mk/') == -1 |
221 | and not name.endswith('buildlink3.mk') | | 221 | and not name.endswith('buildlink3.mk') |
222 | and not name.endswith('cargo-depends.mk') | | 222 | and not name.endswith('cargo-depends.mk') |
223 | and not name.endswith('go-modules.mk'), | | 223 | and not name.endswith('go-modules.mk'), |
224 | makefiles)) | | 224 | makefiles)) |
225 | if not args.wip: | | 225 | if not args.wip: |
226 | makefiles = list(filter(lambda name: name.find('/wip/') == -1, makefiles)) | | 226 | makefiles = list(filter(lambda name: name.find('/wip/') == -1, makefiles)) |
227 | | | 227 | |
228 | print(f"Checking packages using {args.package}:") | | 228 | print(f"Checking packages using {args.package}:") |
229 | checked_packages = set([]) | | 229 | checked_packages = set([]) |
| @@ -233,17 +233,17 @@ for makefile in makefiles: | | | @@ -233,17 +233,17 @@ for makefile in makefiles: |
233 | | | 233 | |
234 | searchlist = set([args.package]) | | 234 | searchlist = set([args.package]) |
235 | handled = set([]) | | 235 | handled = set([]) |
236 | while searchlist: | | 236 | while searchlist: |
237 | entry = searchlist.pop() | | 237 | entry = searchlist.pop() |
238 | if entry in handled: | | 238 | if entry in handled: |
239 | continue | | 239 | continue |
240 | handled.add(entry) | | 240 | handled.add(entry) |
241 | | | 241 | |
242 | entry_versions = supported_versions(entry) | | 242 | entry_versions = supported_versions(entry) |
243 | for package, dependencies in includes.items(): | | 243 | for package, dependencies in includes.items(): |
244 | if entry in dependencies: | | 244 | if entry in dependencies: |
245 | package_versions = supported_versions(package) | | 245 | package_versions = supported_versions(package) |
246 | if entry_versions < package_versions: | | 246 | if not entry_versions.issuperset(package_versions): |
247 | report_problem(package, package_versions, package_versions, entry_versions) | | 247 | report_problem(package, package_versions, entry_versions. package_versions) |
248 | python_versions[package] = entry_versions | | 248 | python_versions[package] = entry_versions |
249 | searchlist.add(package) | | 249 | searchlist.add(package) |