diff options
Diffstat (limited to 'calm/compare-arches')
-rwxr-xr-x | calm/compare-arches | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/calm/compare-arches b/calm/compare-arches deleted file mode 100755 index 4e2dd19..0000000 --- a/calm/compare-arches +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2015 Jon Turney -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# - -# -# compare-arch - compare package sets between architectures -# - -import argparse -import logging -import os -import sys - -import common_constants -import maintainers -import package - - -# -# -# - -def main(args): - packages = {} - pset = {} - union = set() - - for arch in common_constants.ARCHES: - # build package list - packages[arch] = package.read_packages(args.rel_area, arch) - - # make a set of the package list - pset[arch] = frozenset(packages[arch].keys()) - - # make the union of all the package lists - union = union.union(pset[arch]) - - # XXX: could filter out obsolete here - - for p in sorted(union): - exists = {} - obs = {} - - for arch in common_constants.ARCHES: - exists[arch] = False - obs[arch] = True - if p in packages[arch]: - exists[arch] = True - if '_obsolete' in packages[arch][p].hints.get('category', ''): - obs[arch] = True - else: - obs[arch] = False - - if p.startswith('cygwin32') or p.startswith('cygwin64') or p.endswith('-debuginfo'): - continue - - # packages which exist in all arches - if all(exists.values()): - - # report packages which are obsolete only in some arch - if any(obs.values()) and not all(obs.values()): - print("%s is in all arches, but obsolete only in %s" % (p, [a for a in obs if obs[a]])) - - continue - - # ignore packages which are obsolete in all the arches they exist in - if all(obs.values()): - continue - - -# print(p, exists, obs) - print("%s is only in arch %s" % (p, [a for a in exists if exists[a]])) - - # are there any packages which have a maintainer, but don't exist? - mlist = maintainers.read(args, getattr(args, 'orphanmaint', None)) - all_packages = maintainers.all_packages(mlist) - - for p in sorted(all_packages): - if p not in union: - logging.warning("package '%s' has a maintainer, but doesn't exist in any architecture" % (p)) - - # find the set of packages which aren't in an arch -# for arch in common_constants.ARCHES: -# diff = union.difference(pset[arch]) -# print("only in %s" % arch) -# print(sorted(diff)) - - -# -# -# - -if __name__ == "__main__": - homedir_default = common_constants.HOMEDIR - pkglist_default = common_constants.PKGMAINT - relarea_default = common_constants.FTP - - parser = argparse.ArgumentParser(description='Compare arch package sets') - parser.add_argument('--homedir', action='store', metavar='DIR', help="maintainer home directory (default: " + homedir_default + ")", default=homedir_default) - parser.add_argument('--pkglist', action='store', metavar='FILE', help="package maintainer list (default: " + pkglist_default + ")", default=pkglist_default) - parser.add_argument('--releasearea', action='store', metavar='DIR', help="release directory (default: " + relarea_default + ")", default=relarea_default, dest='rel_area') - parser.add_argument('-v', '--verbose', action='count', dest='verbose', help='verbose output') - (args) = parser.parse_args() - - if args.verbose: - logging.getLogger().setLevel(logging.INFO) - - logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') - - main(args) |