]> arthur.barton.de Git - bup.git/commitdiff
configure-sampledata: test -h before -e when appropriate in --clean.
authorRob Browning <rlb@defaultvalue.org>
Sun, 17 Mar 2013 18:03:03 +0000 (13:03 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 17 Mar 2013 18:07:13 +0000 (13:07 -0500)
Use "test -h" before "test -e" for items that might be dangling
symlinks since "test -e" returns false in that case.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/configure-sampledata

index 8029f0dafe6feeeaefa605ba07868c7b45c9c270..d57d0dd7395379bc6dfc2881b978624261c2a38e 100755 (executable)
@@ -25,9 +25,10 @@ case "$1" in
     '--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
+            # test -e is false for dangling symlinks.
+            if test -h b -o -e b; then rm b; fi
+            if test -h c -o -e c; then rm c; fi
+            if test -h etc -o -e etc; then rm etc; fi
         )
         ;;
     *)