]> arthur.barton.de Git - bup.git/blobdiff - t/configure-sampledata
test-compression.sh: use "tar ... | wc -c" instead of du.
[bup.git] / t / configure-sampledata
index 8029f0dafe6feeeaefa605ba07868c7b45c9c270..79bf8a44f49411ef032c4503c07390b41b8ce787 100755 (executable)
@@ -1,7 +1,5 @@
 #!/usr/bin/env bash
 
-set -e -o pipefail
-
 top=$(pwd)
 
 usage()
@@ -16,18 +14,19 @@ fi
 case "$1" in
     '--setup')
         (
-            cd t/sampledata
-            ln -sf a b
-            ln -sf b c
-            ln -sf /etc .
-        )
+            cd t/sampledata || exit $?
+            ln -sf a b || exit $?
+            ln -sf b c || exit $?
+            ln -sf /etc . || exit $?
+        ) || exit $?
         ;;
     '--clean')
         (
-            cd t/sampledata
-            if test -e b; then rm b; fi
-            if test -e c; then rm c; fi
-            if test -e etc; then rm etc; fi
+            cd t/sampledata || exit $?
+            # test -e is false for dangling symlinks.
+            if test -h b -o -e b; then rm b || exit $?; fi
+            if test -h c -o -e c; then rm c || exit $?; fi
+            if test -h etc -o -e etc; then rm etc || exit $?; fi
         )
         ;;
     *)