diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2023-01-17 17:39:07 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-02-19 20:01:42 +0300 |
commit | c4e67ed59aeaffd4e3c519c27445e9a776213359 (patch) | |
tree | 0ce1a075738b25a7491428cab4fd8b8907f8e963 /calm/package.py | |
parent | 6be5440ff6d88db80bf862d04504c74610f7ed7a (diff) |
Revise maintainers module
The data ordered by package name is the one we use the most often, so
make that the primary form.
Also use mtime_cache for the result of parsing cygwin-pkg-maint.
v2:
Fix mkgitolite and reports
Keep maintainers in a list, not a set, because we need "first named
maintainer".
Don't write permissions lines with an empty list of names, as that's
syntactically incorrect.
Diffstat (limited to 'calm/package.py')
-rwxr-xr-x | calm/package.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/calm/package.py b/calm/package.py index 81d07fe..21639cb 100755 --- a/calm/package.py +++ b/calm/package.py @@ -1086,13 +1086,11 @@ def validate_package_maintainers(args, packages): if not args.pkglist: return error - # read maintainer list - mlist = {} - mlist = maintainers.add_packages(mlist, args.pkglist) - pkg_maintainers = maintainers.invert(mlist) + # read package maintainer list + pkg_maintainers = maintainers.pkg_list(args.pkglist) # make the list of all packages - all_packages = maintainers.all_packages(mlist) + all_packages = pkg_maintainers.keys() # validate that all packages are in the package list for p in sorted(packages): @@ -1120,7 +1118,7 @@ def validate_package_maintainers(args, packages): logging.error("package '%s' is not obsolete, but has no maintainer" % (p)) error = True - if 'ORPHANED' in pkg_maintainers[es_pn]: + if (es_pn in pkg_maintainers) and (pkg_maintainers[es_pn].is_orphaned()): # note orphaned packages packages[p].orphaned = True @@ -1353,8 +1351,7 @@ def write_repo_json(args, packages, f): for arch in packages: package_list.update(packages[arch]) - mlist = maintainers.read(args, None) - pkg_maintainers = maintainers.invert(mlist) + pkg_maintainers = maintainers.pkg_list(args.pkglist) pl = [] for pn in sorted(package_list): @@ -1397,8 +1394,8 @@ def write_repo_json(args, packages, f): if 'license' in po.version_hints[bv]: d['license'] = po.version_hints[bv]['license'] - if pkg_maintainers[po.orig_name] and ('ORPHANED' not in pkg_maintainers[po.orig_name]): - d['maintainers'] = sorted(pkg_maintainers[po.orig_name]) + if (po.orig_name in pkg_maintainers) and (not pkg_maintainers[po.orig_name].is_orphaned()): + d['maintainers'] = sorted(pkg_maintainers[po.orig_name].maintainers()) pl.append(d) |