summaryrefslogtreecommitdiffstats
path: root/bin/review-update-needed
diff options
context:
space:
mode:
authorRoberto C. Sánchez <roberto@debian.org>2020-01-30 17:22:06 -0500
committerRoberto C. Sánchez <roberto@debian.org>2020-01-30 17:22:06 -0500
commitcea695e94740666f4ebc7cd0d8a5578cc9036f92 (patch)
tree5b872d427497b4c58115381941d406f51b96cd59 /bin/review-update-needed
parent277dd8f2182f0faa4cfdba8a5713844bbedc0ad3 (diff)
Add rmadison query to review-update-needed to ensure packages exist in specified suite(s)users/roberto/rmadison_review-update-needed
Diffstat (limited to 'bin/review-update-needed')
-rwxr-xr-xbin/review-update-needed29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/review-update-needed b/bin/review-update-needed
index b931221b71..49f64bfbf5 100755
--- a/bin/review-update-needed
+++ b/bin/review-update-needed
@@ -47,6 +47,8 @@ else:
help='Automatically unclaim entries older than N seconds (default: %(default)s)')
parser.add_argument('--exclude', nargs='+', metavar='PACKAGE', default=[],
help='completely ignore packages specified PACKAGE')
+parser.add_argument('--exist-in', nargs='+', metavar='SUITE', default=[],
+ help='query rmadison for existence in SUITE')
args = parser.parse_args()
if args.verbose and args.quiet:
args.error("--verbose and --quiet contradiction")
@@ -123,11 +125,38 @@ if retcode != 0:
all_entries.sort(key=lambda x: x[args.sort_by])
+if args.exist_in:
+ process = subprocess.Popen(["rmadison", "-u", "debian", "-a", "source",
+ "-s", ",".join(args.exist_in),
+ " ".join([entry['pkg'] for entry in all_entries])],
+ stdout=subprocess.PIPE)
+
+ rmadison = []
+ for line in process.stdout:
+ pkg, ver, suite, arch = [f.strip() for f in line.decode('utf-8').split('|')]
+ rmadison.append((pkg, suite))
+ for entry in all_entries:
+ in_suites = set()
+ for suite in args.exist_in:
+ if (entry['pkg'], suite) in rmadison:
+ in_suites.add(suite)
+ missing_from = set(args.exist_in).difference(in_suites)
+ if len(missing_from) > 0:
+ entry.update({'missing-from': ",".join(missing_from)})
+ else:
+ entry.update({'missing-from': None})
+
+ retcode = process.wait()
+ if retcode != 0:
+ sys.stderr.write("WARNING: rmadison returned error code {}\n".format(retcode))
+
unclaim_pkgs = []
for entry in all_entries:
if args.skip_unclaimed and not entry['claimed-by']:
continue
args.quiet or print("Package: {}".format(entry['pkg']))
+ if entry['missing-from']:
+ args.quiet or print("Missing-From: {}".format(entry['missing-from']))
if entry['claimed-by']:
args.quiet or print("Claimed-By: {}".format(entry['claimed-by']))
args.quiet or print("Claimed-Date: {}".format(format_date(entry['claimed-date'])))

© 2014-2024 Faster IT GmbH | imprint | privacy policy