]> arthur.barton.de Git - bup.git/blobdiff - t/lib.sh
test-ls.sh: get the symlink mode from the host ls; test for subcmd failure.
[bup.git] / t / lib.sh
index 93b2e598bb50b7ad62c90905c1e48f1c88d42bbf..372f0d20d5d5983ee0c8428d3a6cdda9473344c3 100644 (file)
--- a/t/lib.sh
+++ b/t/lib.sh
@@ -4,28 +4,7 @@ bup_t_lib_script_home=$(cd "$(dirname $0)" && pwd)
 
 force-delete()
 {
-    local rc=0
-    # Try *hard* to delete $@.  Among other things, some systems have
-    # r-xr-xr-x for root and other system dirs.
-    rm -rf "$@" # Maybe we'll get lucky.
-    for f in "$@"; do
-        test -e "$f" || continue
-        if test "$(type -p setfacl)"; then
-            setfacl -Rb "$f"
-        fi
-        if test "$(type -p chattr)"; then
-            chattr -R -aisu "$f"
-        fi
-        chmod -R u+rwX "$f"
-        rm -r "$f"
-        if test -e "$f"; then
-            rc=1
-            find "$f" -ls
-            lsattr -aR "$f"
-            getfacl -R "$f"
-        fi
-    done
-    return $rc
+    "$bup_t_lib_script_home/force-delete" "$@"
 }
 
 realpath()