WVFAIL bup save -t $D/d/e/fifotest
mkfifo $D/d/e/fifotest
WVPASS bup index -u $D/d/e/fifotest
-WVFAIL bup save -t $D/d/e/fifotest
-WVFAIL bup save -t $D/d/e
+WVPASS bup save -t $D/d/e/fifotest
+WVPASS bup save -t $D/d/e
rm -f $D/d/e/fifotest
WVPASS bup index -u $D/d/e
WVFAIL bup save -t $D/d/e/fifotest
mkdir $D/d $D/d/e
WVPASS bup random 512 >$D/f
WVPASS bup index -ux $D
+WVFAIL bup save --graft =/grafted -n graft-point-absolute $D
+WVFAIL bup save --graft $TOP/$D= -n graft-point-absolute $D
bup save --graft $TOP/$D=/grafted -n graft-point-absolute $D
WVPASSEQ "$(bup ls graft-point-absolute/latest/grafted/)" "a
b
# is harmless there.)
WVPASSEQ "$(bup ls compression/latest/ | sort)" \
"$(ls $TOP/Documentation | grep -v '^\.' | sort)"
-COMPRESSION_0_SIZE=$(du -s $D | cut -f1)
+COMPRESSION_0_SIZE=$(du -k -s $D | cut -f1)
D=compression9.tmp
export BUP_DIR="$TOP/$D/.bup"
WVPASS bup index $TOP/Documentation
WVPASS bup save -n compression -9 --strip $TOP/Documentation
WVPASSEQ "$(bup ls compression/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
-COMPRESSION_9_SIZE=$(du -s $D | cut -f1)
+COMPRESSION_9_SIZE=$(du -k -s $D | cut -f1)
WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]
+
+
+WVSTART "save disjoint top-level directories"
+(
+ set -e
+ top_dir="$(echo $(pwd) | awk -F "/" '{print $2}')"
+ if [ "$top_dir" == tmp ]; then
+ echo "(running from within /tmp; skipping test)"
+ exit 0
+ fi
+ D=bupdata.tmp
+ rm -rf $D
+ mkdir -p $D/x
+ date > $D/x/1
+ tmpdir="$(mktemp --tmpdir=/tmp -d bup-test-XXXXXXX)"
+ cleanup() { set -x; rm -rf "${tmpdir}"; set +x; }
+ trap cleanup EXIT
+ date > "$tmpdir/2"
+
+ export BUP_DIR="$TOP/buptest.tmp"
+ rm -rf "$BUP_DIR"
+
+ WVPASS bup init
+ WVPASS bup index -vu $(pwd)/$D/x "$tmpdir"
+ WVPASS bup save -t -n src $(pwd)/$D/x "$tmpdir"
+ # For now, assume that "ls -a" and "sort" use the same order.
+ WVPASSEQ "$(bup ls -a src/latest)" "$(echo -e "$top_dir/\ntmp/" | sort)"
+) || WVFAIL