From 9ef6a6deb4d5417326a08fc029072a6524feaf3a Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 20 Jan 2009 19:06:16 +0000 Subject: [PATCH] List failed paths in "0store audit" output This makes it easy to bulk delete a large number of corrupted implementations (or move them elsewhere for examination and possible recovery with "0store copy"). --- zeroinstall/zerostore/cli.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zeroinstall/zerostore/cli.py b/zeroinstall/zerostore/cli.py index 85359ff..5f76315 100644 --- a/zeroinstall/zerostore/cli.py +++ b/zeroinstall/zerostore/cli.py @@ -150,7 +150,7 @@ def do_audit(args): raise SafeException("No such directory '%s'" % a.dir) verified = 0 - failed = 0 + failures = [] i = 0 for root, impls in audit_ls: print "Scanning", root @@ -169,15 +169,20 @@ def do_audit(args): verified += 1 except zerostore.BadDigest, ex: print - failed += 1 + failures.append(path) print str(ex) if ex.detail: print print ex.detail + if failures: + print "\nList of corrupted or modified implementations:" + for x in failures: + print x + print print "Checked %d items" % i print "Successfully verified implementations: %d" % verified - print "Corrupted or modified implementations: %d" % failed - if failed: + print "Corrupted or modified implementations: %d" % len(failures) + if failures: sys.exit(1) def show_changes(actual, saved): -- 2.11.4.GIT