[Reproducible-commits] [misc] 01/01: reports: newly-reproducible: rename --verify to --interactive and don't fail if subprocess fails
Ximin Luo
infinity0 at debian.org
Mon Aug 8 18:16:33 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository misc.
commit fd270ee8d5996f2a186051668ddb162f9d706771
Author: Ximin Luo <infinity0 at debian.org>
Date: Mon Aug 8 20:16:00 2016 +0200
reports: newly-reproducible: rename --verify to --interactive and don't fail if subprocess fails
---
reports/bin/newly-reproducible | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/reports/bin/newly-reproducible b/reports/bin/newly-reproducible
index 143e075..2cb8b4d 100755
--- a/reports/bin/newly-reproducible
+++ b/reports/bin/newly-reproducible
@@ -13,6 +13,7 @@ import sys
import sqlite3
import termios
import time
+import traceback
import tty
def read1charmode(fd):
@@ -26,7 +27,13 @@ def output(name, details):
detail_string = "; ".join("on %s %s" % (", ".join(v), k) for k, v in details.items())
print("[[!pkg %s]] is reproducible %s." % (name, detail_string))
-def verify(name, details, fd=sys.stdin, nextname=None, prevname=None):
+def trace_call(*args, **kwargs):
+ try:
+ subprocess.check_call(*args, **kwargs)
+ except Exception:
+ traceback.print_exc()
+
+def interact(name, details, fd=sys.stdin, nextname=None, prevname=None):
oldattr = termios.tcgetattr(fd)
newattr = read1charmode(fd)
try:
@@ -63,9 +70,9 @@ Enter Go to next item or quit if last item
elif c == "h":
print(helptext)
elif c == "v":
- subprocess.check_call(["bin/history", "-l"] + full + [name] + suite)
+ trace_call(["bin/history", "-l"] + full + [name] + suite)
elif c == "c":
- subprocess.check_call(["less", os.path.join(os.path.dirname(db_path), "changelogs", name)])
+ trace_call(["less", os.path.join(os.path.dirname(db_path), "changelogs", name)])
elif c == "x":
full = ["-x"] if not full else []
elif c in "tue":
@@ -80,7 +87,7 @@ Enter Go to next item or quit if last item
parser = argparse.ArgumentParser(
description='find packages that became reproducible in the past week')
parser.add_argument(
- '--verify', action="store_true", default=False,
+ '-i', '--interactive', action="store_true", default=False,
help='enter an interactive REPL to examine each package in more detail')
parser.add_argument(
'package', nargs="*",
@@ -151,14 +158,14 @@ for package_id in sorted(now_reproducible.keys()):
now_reproducible_by_arch.setdefault(name, {}).setdefault(now_reproducible[package_id], []).append(architecture)
all_details = sorted(now_reproducible_by_arch.items())
-if args.verify:
+if args.interactive:
i = 0
n = len(all_details)
while i < n:
name, details = all_details[i]
nextname = all_details[(i-1)%n][0]
prevname = all_details[(i+1)%n][0]
- chg = verify(name, details, sys.stdin, nextname, prevname)
+ chg = interact(name, details, sys.stdin, nextname, prevname)
if chg is None:
if i == len(all_details) - 1:
break
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list