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
WVSTART "restore"
rm -rf buprestore.tmp
WVFAIL bup restore boink
+touch $TOP/$D/$D
+bup index -u $TOP/$D
+bup save -n master /
WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
rm -rf buprestore.tmp
WVPASS bup random 512 >$D/f
WVPASS bup index -ux $D
bup save -n exclude-bupdir $D
-WVPASSEQ "$(bup ls exclude-bupdir/latest/$TOP/$D/)" "a
+WVPASSEQ "$(bup ls -a exclude-bupdir/latest/$TOP/$D/)" "a
b
d/
f"
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
c/"
+if [ "$(which rdiff-backup)" != "" ]; then
+ WVSTART "import-rdiff-backup"
+ D=rdiff-backup.tmp
+ export BUP_DIR="$TOP/$D/.bup"
+ rm -rf $D
+ mkdir $D
+ WVPASS bup init
+ mkdir $D/rdiff-backup
+ rdiff-backup $TOP/cmd $D/rdiff-backup
+ bup tick
+ rdiff-backup $TOP/Documentation $D/rdiff-backup
+ WVPASS bup import-rdiff-backup $D/rdiff-backup import-rdiff-backup
+ WVPASSEQ "$(bup ls import-rdiff-backup/ | wc -l)" "3"
+ WVPASSEQ "$(bup ls import-rdiff-backup/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
+fi
+
+
WVSTART "compression"
D=compression0.tmp
export BUP_DIR="$TOP/$D/.bup"
# 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