[tor-commits] [tor/master] Improve cov-diff script to account for new files.
nickm at torproject.org
nickm at torproject.org
Thu Sep 28 12:53:19 UTC 2017
commit 9727a9248a474909c0ad53be9d55cd39b69d0611
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Sep 28 08:53:16 2017 -0400
Improve cov-diff script to account for new files.
---
scripts/test/cov-diff | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/test/cov-diff b/scripts/test/cov-diff
index 7da7f0be9..ed8874d2d 100755
--- a/scripts/test/cov-diff
+++ b/scripts/test/cov-diff
@@ -7,9 +7,13 @@
DIRA="$1"
DIRB="$2"
-for A in $DIRA/*; do
- B=$DIRB/`basename $A`
- perl -pe 's/^\s*\!*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$A" > "$A.tmp"
+for B in $DIRB/*; do
+ A=$DIRA/`basename $B`
+ if [ -f $A ]; then
+ perl -pe 's/^\s*\!*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$A" > "$A.tmp"
+ else
+ cat /dev/null > "$A.tmp"
+ fi
perl -pe 's/^\s*\!*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$B" > "$B.tmp"
diff -u "$A.tmp" "$B.tmp"
rm "$A.tmp" "$B.tmp"
More information about the tor-commits
mailing list