]> arthur.barton.de Git - bup.git/commitdiff
configure-sampledata: remove vestigial etc too
authorRob Browning <rlb@defaultvalue.org>
Sat, 11 Apr 2015 17:10:38 +0000 (12:10 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 11 Apr 2015 17:43:02 +0000 (12:43 -0500)
Thanks to Mark J Hewitt for reporting the problem.

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

index 1603fd8370d1d8f2f3940cfd1fb512d241c14401..e23a3082abd8a13508026b180b6b05dd30722311 100755 (executable)
@@ -19,17 +19,20 @@ if test "$#" -ne 1; then
     usage 1>&2; exit 1
 fi
 
+rm_symlinks()
+{
+    for p in "$@"; do
+        # test -e is false for dangling symlinks.
+        if test -h "$p" -o -e "$p"; then rm "$p" || exit $?; fi
+    done
+}
+
 clean()
 (
     cd t/sampledata || exit $?
     if test -e var; then rm -r var || exit $?; fi
     # Remove legacy content (before everything moved to var/).
-    # 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 abs-symlink -o -e abs-symlink; then
-        rm abs-symlink || exit $?
-    fi
+    rm_symlinks abs-symlink b c etc
 )
 
 case "$1" in