Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve output of check_dist_archive.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sat, 2 Feb 2013 14:52:03 +0000 (15:52 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sat, 2 Feb 2013 23:40:55 +0000 (00:40 +0100)
tools/check_dist_archive

index ca1f75e..38fe76d 100755 (executable)
@@ -81,7 +81,14 @@ find b -type f \
     | sort > "$fb"
 
 diffcmd() {
-    diff -u "$fa" "$fb"
+    if cmp -s "$fa" "$fb"; then
+        status=0
+        echo "The archive looks good."
+    else
+        status=1
+        echo "Some files are missing and/or unexpected in the archive."
+        diff -u "$fa" "$fb"
+    fi
 }
 
 colordiff=$(type -p colordiff)
@@ -97,4 +104,6 @@ if [ "$interactive" = "1" ]; then
     diffcmd | colorless
 else
     diffcmd
-fi
+fi || true
+
+exit $status