Only call chattr and setfacl on Linux for now.
Test that each item is actually gone.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
--- /dev/null
+
+force-delete()
+{
+ # 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 "$@" || continue
+ chmod -R u+w "$@"
+ if [[ $(uname) =~ Linux ]]; then
+ chattr -fR = "$@"
+ setfacl -Rb "$@"
+ fi
+ rm -r "$@"
+ if test -e "$@"; then
+ return 1
+ fi
+ done
+}
#!/usr/bin/env bash
. wvtest.sh
+. t/lib.sh
TOP="$(pwd)"
export BUP_DIR="$TOP/buptest.tmp"
test "$(whoami)" == root -a -z "$FAKEROOTKEY"
}
-force-delete()
-{
- if ! actually-root; then
- rm -rf "$@"
- else
- # Go to greater lengths to deal with any test detritus.
- for f in "$@"; do
- test -e "$@" || continue
- chattr -fR = "$@" || true
- setfacl -Rb "$@"
- rm -r "$@"
- done
- fi
-}
-
test-src-create-extract()
{
# Test bup meta create/extract for ./src -> ./src-restore.
#!/usr/bin/env bash
. wvtest.sh
+. t/lib.sh
+
#set -e
TOP="$(/bin/pwd)"
"$TOP/bup" "$@"
}
-force-delete()
-{
- chmod -R u+w "$@"
- for f in "$@"; do
- test -e "$@" || continue
- chattr -fR = "$@" || true
- setfacl -Rb "$@"
- rm -r "$@"
- done
-}
-
WVSTART "init"
#set -x