8 export BUP_DIR="$TOP/buptest.tmp"
18 test -d "$BUP_DIR" && rm -r "$BUP_DIR"
25 WVFAIL bup index --exclude-from $D/cannot-exist $D
26 WVPASSEQ "$(bup index --check -p)" ""
27 WVPASSEQ "$(bup index --check -p $D)" ""
29 WVFAIL bup index --check -u $D.fake
30 WVPASS bup index --check -u $D
31 WVPASSEQ "$(bup index --check -p $D)" "$D/"
33 WVPASS bup random 128k >$D/b
35 WVPASS bup random 512 >$D/f
36 WVPASS ln -s non-existent-file $D/g
37 WVPASSEQ "$(bup index -s $D/)" "A $D/"
38 WVPASSEQ "$(bup index -s $D/b)" ""
39 WVPASSEQ "$(bup index --check -us $D/b)" "A $D/b"
40 WVPASSEQ "$(bup index --check -us $D/b $D/d)" \
46 WVPASSEQ "$(bup index --check -usx $D)" \
55 WVPASSEQ "$(bup index --check -us $D/a $D/b --fake-valid)" \
58 WVPASSEQ "$(bup index --check -us $D/a)" " $D/a" # stays unmodified
59 WVPASSEQ "$(bup index --check -us $D/d --fake-valid)" \
64 WVPASS bup index -u $D/d/z # becomes modified
65 WVPASSEQ "$(bup index -s $D/a $D $D/b)" \
75 WVPASS bup index -u $D/d/e $D/a --fake-invalid
76 WVPASSEQ "$(cd $D && bup index -m .)" \
84 WVPASSEQ "$(cd $D && bup index -m)" \
92 WVPASSEQ "$(cd $D && bup index -s .)" "$(cd $D && bup index -s .)"
94 WVFAIL bup save -t $D/doesnt-exist-filename
96 mv $BUP_DIR/bupindex $BUP_DIR/bi.old
97 WVFAIL bup save -t $D/d/e/fifotest
98 mkfifo $D/d/e/fifotest
99 WVPASS bup index -u $D/d/e/fifotest
100 WVPASS bup save -t $D/d/e/fifotest
101 WVPASS bup save -t $D/d/e
102 rm -f $D/d/e/fifotest
103 WVPASS bup index -u $D/d/e
104 WVFAIL bup save -t $D/d/e/fifotest
105 mv $BUP_DIR/bi.old $BUP_DIR/bupindex
107 WVPASS bup index -u $D/d/e
108 WVPASS bup save -t $D/d/e
109 WVPASSEQ "$(cd $D && bup index -m)" \
116 WVPASS bup save -t $D/d
117 WVPASS bup index --fake-invalid $D/d/z
118 WVPASS bup save -t $D/d/z
119 WVPASS bup save -t $D/d/z # test regenerating trees when no files are changed
120 WVPASS bup save -t $D/d
121 WVPASSEQ "$(cd $D && bup index -m)" \
126 tree1=$(bup save -t $D) || WVFAIL
127 WVPASSEQ "$(cd $D && bup index -m)" ""
128 tree2=$(bup save -t $D) || WVFAIL
129 if ! [[ $(uname) =~ CYGWIN ]]; then
130 # On Cygwin, the access time may change.
131 WVPASSEQ "$tree1" "$tree2"
133 WVPASSEQ "$(bup index -s / | grep ^D)" ""
134 tree3=$(bup save -t /) || WVFAIL
135 if ! [[ $(uname) =~ CYGWIN ]]; then
136 # On Cygwin, the access time may change.
137 WVPASSEQ "$tree1" "$tree3"
139 WVPASS bup save -r :$BUP_DIR -n r-test $D
140 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
141 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
146 WVPASS bup split -b a.tmp >taga.tmp
147 WVPASS bup split -b b.tmp >tagb.tmp
148 cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
149 WVPASSEQ $(cat taga.tmp | wc -l) 1
150 WVPASSEQ $(cat tagb.tmp | wc -l) 1
151 WVPASSEQ $(cat tagab.tmp | wc -l) 1
152 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
153 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
154 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
155 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
157 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
159 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
160 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
163 WVPASS bup midx --check -a
164 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
165 $BUP_DIR/objects/pack/*.idx
166 WVPASS bup midx --check -a
167 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
168 $BUP_DIR/objects/pack/*.idx \
169 $BUP_DIR/objects/pack/*.idx
170 WVPASS bup midx --check -a
171 all=$(echo $BUP_DIR/objects/pack/*.idx $BUP_DIR/objects/pack/*.midx)
172 WVPASS bup midx -o $BUP_DIR/objects/pack/zzz.midx $all
174 WVPASS bup midx -o $BUP_DIR/objects/pack/yyy.midx $all
176 WVPASSEQ "$(echo $BUP_DIR/objects/pack/*.midx)" \
177 "$BUP_DIR/objects/pack/yyy.midx"
179 WVPASS bup split -t t/testfile2 >tags2t.tmp
180 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
181 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
182 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
184 | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
186 WVFAIL bup ls /does-not-exist
188 WVPASS bup ls /lslr/latest
189 WVPASS bup ls /lslr/latest/
190 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
191 WVFAIL diff -u tags1.tmp tags2.tmp
193 # fanout must be different from non-fanout
194 WVFAIL diff tags2t.tmp tags2tf.tmp
195 wc -c t/testfile1 t/testfile2
196 wc -l tags1.tmp tags2.tmp
199 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
200 rm $BUP_DIR/objects/pack/bup.bloom
201 WVPASS bup bloom -k 4
202 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
203 WVPASS bup bloom -d buptest.tmp/objects/pack --ruin --force
204 WVFAIL bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
205 WVPASS bup bloom --force -k 5
206 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
209 WVPASS bup memtest -c1 -n100
210 WVPASS bup memtest -c1 -n100 --existing
213 WVPASS bup join $(cat tags1.tmp) >out1.tmp
214 WVPASS bup join <tags2.tmp >out2.tmp
215 WVPASS bup join <tags2t.tmp -o out2t.tmp
216 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
217 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
218 WVPASS diff -u t/testfile1 out1.tmp
219 WVPASS diff -u t/testfile2 out2.tmp
220 WVPASS diff -u t/testfile2 out2t.tmp
221 WVPASS diff -u t/testfile2 out2c.tmp
223 WVSTART "save/git-fsck"
226 cd "$BUP_DIR" || exit 1
229 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
230 n=$(git fsck --full --strict 2>&1 |
231 egrep -v 'dangling (commit|tree|blob)' |
234 WVPASS [ "$n" -eq 0 ]
238 force-delete buprestore.tmp
239 WVFAIL bup restore boink
243 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
244 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
245 force-delete buprestore.tmp
246 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D/"
247 touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
248 WVPASS diff -ur $D/ buprestore.tmp/
254 export BUP_DIR="$(pwd)/$tmp/bup"
256 mkdir -p $tmp/src/x/y/z
257 WVPASS bup random 8k > $tmp/src/x/y/random-1
258 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
259 WVPASS bup index -u $tmp/src
260 WVPASS bup save --strip -n foo $tmp/src
262 WVSTART "restore /foo/latest"
263 WVPASS bup restore -C $tmp/restore /foo/latest
264 WVPASS t/compare-trees $tmp/src/ $tmp/restore/latest/
266 WVSTART "restore /foo/latest/"
267 force-delete "$tmp/restore"
268 WVPASS bup restore -C $tmp/restore /foo/latest/
269 for x in $tmp/src/*; do
270 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
273 WVSTART "restore /foo/latest/."
274 force-delete "$tmp/restore"
275 WVPASS bup restore -C $tmp/restore /foo/latest/.
276 WVPASS t/compare-trees $tmp/src/ $tmp/restore/
278 WVSTART "restore /foo/latest/x"
279 force-delete "$tmp/restore"
280 WVPASS bup restore -C $tmp/restore /foo/latest/x
281 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/x/
283 WVSTART "restore /foo/latest/x/"
284 force-delete "$tmp/restore"
285 WVPASS bup restore -C $tmp/restore /foo/latest/x/
286 for x in $tmp/src/x/*; do
287 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
290 WVSTART "restore /foo/latest/x/."
291 force-delete "$tmp/restore"
292 WVPASS bup restore -C $tmp/restore /foo/latest/x/.
293 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/
298 WVPASS bup ftp "cat /master/latest/$TOP/$D/b" >$D/b.new
299 WVPASS bup ftp "cat /master/latest/$TOP/$D/f" >$D/f.new
300 WVPASS bup ftp "cat /master/latest/$TOP/$D/f"{,} >$D/f2.new
301 WVPASS bup ftp "cat /master/latest/$TOP/$D/a" >$D/a.new
302 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
303 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
304 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
305 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
308 WVFAIL bup tag -d v0.n 2>/dev/null
309 WVFAIL bup tag v0.n non-existant 2>/dev/null
310 WVPASSEQ "$(bup tag)" ""
311 WVPASS bup tag v0.1 master
312 WVPASSEQ "$(bup tag)" "v0.1"
313 WVPASS bup tag -d v0.1
315 # This section destroys data in the bup repository, so it is done last.
318 WVPASS bup fsck --quick
319 if bup fsck --par2-ok; then
320 WVSTART "fsck (par2)"
322 WVSTART "fsck (PAR2 IS MISSING)"
326 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
327 WVFAIL bup fsck --quick
328 WVFAIL bup fsck --quick --disable-par2
329 chmod u+w $BUP_DIR/objects/pack/*.idx
330 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
331 WVFAIL bup fsck --quick -j4
332 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
333 WVFAIL bup fsck --quick
334 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
335 if bup fsck --par2-ok; then
336 WVPASS bup fsck -r # ok because of repairs from last time
337 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
339 WVFAIL bup fsck -rvv # too many errors to be repairable
340 WVFAIL bup fsck -r # too many errors to be repairable
342 WVFAIL bup fsck --quick -r # still fails because par2 was missing
345 WVSTART "exclude-bupdir"
349 export BUP_DIR="$D/.bup"
352 WVPASS bup random 128k >$D/b
354 WVPASS bup random 512 >$D/f
355 WVPASS bup index -ux $D
356 bup save -n exclude-bupdir $D
357 WVPASSEQ "$(bup ls -a exclude-bupdir/latest/$TOP/$D/)" "a
368 export BUP_DIR="$D/.bup"
371 WVPASS bup random 128k >$D/b
373 WVPASS bup random 512 >$D/f
374 WVPASS bup random 512 >$D/j
375 WVPASS bup index -ux --exclude $D/d --exclude $D/j $D
376 bup save -n exclude $D
377 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
381 WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h \
382 --exclude $TOP/$D/j $D
383 bup save -n exclude $D
384 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
389 WVSTART "exclude-from"
392 D=exclude-fromdir.tmp
393 EXCLUDE_FILE=exclude-from.tmp
397 $D/i" > $EXCLUDE_FILE
400 export BUP_DIR="$D/.bup"
403 WVPASS bup random 128k >$D/b
405 WVPASS bup random 512 >$D/f
407 WVPASS bup random 128k > $D/i
408 WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D
409 bup save -n exclude-from $D
410 WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a
416 WVSTART "save (no index)"
419 tmp=save-no-index.tmp
422 export BUP_DIR="$(pwd)/$tmp/bup"
424 WVFAIL bup save -n nothing /
428 WVSTART "save --strip"
433 export BUP_DIR="$(pwd)/$tmp/bup"
435 mkdir -p $tmp/src/x/y/z
436 WVPASS bup random 8k > $tmp/src/x/y/random-1
437 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
438 WVPASS bup index -u $tmp/src
439 WVPASS bup save --strip -n foo $tmp/src/x/y
440 WVPASS bup restore -C $tmp/restore /foo/latest
441 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/"
444 WVSTART "save --strip-path (relative)"
449 export BUP_DIR="$(pwd)/$tmp/bup"
451 mkdir -p $tmp/src/x/y/z
452 WVPASS bup random 8k > $tmp/src/x/y/random-1
453 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
454 WVPASS bup index -u $tmp/src
455 WVPASS bup save --strip-path $tmp/src -n foo $tmp/src/x
456 WVPASS bup restore -C $tmp/restore /foo/latest
457 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/"
460 WVSTART "save --strip-path (absolute)"
465 export BUP_DIR="$(pwd)/$tmp/bup"
467 mkdir -p $tmp/src/x/y/z
468 WVPASS bup random 8k > $tmp/src/x/y/random-1
469 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
470 WVPASS bup index -u $tmp/src
471 WVPASS bup save --strip-path "$TOP" -n foo $tmp/src
472 WVPASS bup restore -C $tmp/restore /foo/latest
473 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$tmp/src/"
476 WVSTART "save --strip-path (no match)"
481 export BUP_DIR="$(pwd)/$tmp/bup"
483 mkdir -p $tmp/src/x/y/z
484 WVPASS bup random 8k > $tmp/src/x/y/random-1
485 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
486 WVPASS bup index -u $tmp/src
487 WVPASS bup save --strip-path $tmp/foo -n foo $tmp/src/x
488 WVPASS bup restore -C $tmp/restore /foo/latest
489 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/"
492 WVSTART "save --graft (empty graft points disallowed)"
497 export BUP_DIR="$(pwd)/$tmp/bup"
499 WVFAIL bup save --graft =/grafted -n graft-point-absolute $tmp
500 WVFAIL bup save --graft $TOP/$tmp= -n graft-point-absolute $tmp
503 WVSTART "save --graft /x/y=/a/b (relative paths)"
508 export BUP_DIR="$(pwd)/$tmp/bup"
510 mkdir -p $tmp/src/x/y/z
511 WVPASS bup random 8k > $tmp/src/x/y/random-1
512 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
513 WVPASS bup index -u $tmp/src
514 WVPASS bup save --graft $tmp/src=x -n foo $tmp/src
515 WVPASS bup restore -C $tmp/restore /foo/latest
516 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/x/"
519 WVSTART "save --graft /x/y=/a/b (matching structure)"
524 export BUP_DIR="$(pwd)/$tmp/bup"
526 mkdir -p $tmp/src/x/y/z
527 WVPASS bup random 8k > $tmp/src/x/y/random-1
528 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
529 WVPASS bup index -u $tmp/src
530 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=$TOP/$tmp/src/a/b" \
532 WVPASS bup restore -C $tmp/restore /foo/latest
533 WVPASS t/compare-trees $tmp/src/x/y/ \
534 "$tmp/restore/latest/$TOP/$tmp/src/a/b/"
537 WVSTART "save --graft /x/y=/a (shorter target)"
542 export BUP_DIR="$(pwd)/$tmp/bup"
544 mkdir -p $tmp/src/x/y/z
545 WVPASS bup random 8k > $tmp/src/x/y/random-1
546 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
547 WVPASS bup index -u $tmp/src
548 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=/a" -n foo $tmp/src/x/y
549 WVPASS bup restore -C $tmp/restore /foo/latest
550 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/a/"
553 WVSTART "save --graft /x=/a/b (longer target)"
556 export BUP_DIR="$(pwd)/$tmp/bup"
560 mkdir -p $tmp/src/x/y/z
561 WVPASS bup random 8k > $tmp/src/x/y/random-1
562 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
563 WVPASS bup index -u $tmp/src
564 WVPASS bup save -v --graft "$TOP/$tmp/src=$TOP/$tmp/src/a/b/c" \
566 WVPASS bup restore -C $tmp/restore /foo/latest
567 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/a/b/c/"
570 WVSTART "save --graft /x=/ (root target)"
573 export BUP_DIR="$(pwd)/$tmp/bup"
577 mkdir -p $tmp/src/x/y/z
578 WVPASS bup random 8k > $tmp/src/x/y/random-1
579 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
580 WVPASS bup index -u $tmp/src
581 WVPASS bup save -v --graft "$TOP/$tmp/src/x=/" -n foo $tmp/src/x
582 WVPASS bup restore -C $tmp/restore /foo/latest
583 WVPASS t/compare-trees $tmp/src/x/ "$tmp/restore/latest/"
586 #WVSTART "save --graft /=/x/ (root source)"
587 # FIXME: Not tested for now -- will require cleverness, or caution as root.
591 INDEXFILE=tmpindexfile.tmp
595 export BUP_DIR="$D/.bup"
600 WVPASS bup index -ux $D
601 bup save --strip -n bupdir $D
602 WVPASSEQ "$(bup ls bupdir/latest/)" "a
605 WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
606 bup save --strip -n indexfile -f $INDEXFILE $D
607 WVPASSEQ "$(bup ls indexfile/latest/)" "a
611 WVSTART "import-rsnapshot"
613 export BUP_DIR="$TOP/$D/.bup"
617 mkdir -p $D/hourly.0/buptest/a
618 touch $D/hourly.0/buptest/a/b
619 mkdir -p $D/hourly.0/buptest/c/d
620 touch $D/hourly.0/buptest/c/d/e
622 WVPASS bup import-rsnapshot $D/
623 WVPASSEQ "$(bup ls buptest/latest/)" "a/
627 if [ "$(which rdiff-backup)" != "" ]; then
628 WVSTART "import-rdiff-backup"
630 export BUP_DIR="$TOP/$D/.bup"
634 mkdir $D/rdiff-backup
635 rdiff-backup $TOP/cmd $D/rdiff-backup
637 rdiff-backup $TOP/Documentation $D/rdiff-backup
638 WVPASS bup import-rdiff-backup $D/rdiff-backup import-rdiff-backup
639 WVPASSEQ "$(bup ls import-rdiff-backup/ | wc -l)" "3"
640 WVPASSEQ "$(bup ls import-rdiff-backup/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
644 WVSTART "compression"
646 export BUP_DIR="$TOP/$D/.bup"
650 WVPASS bup index $TOP/Documentation
651 WVPASS bup save -n compression -0 --strip $TOP/Documentation
652 # 'ls' on NetBSD sets -A by default when running as root, so we have to undo
653 # it by grepping out any dotfiles. (Normal OSes don't auto-set -A, but this
654 # is harmless there.)
655 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
656 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
657 COMPRESSION_0_SIZE=$(du -k -s $D | cut -f1)
660 export BUP_DIR="$TOP/$D/.bup"
664 WVPASS bup index $TOP/Documentation
665 WVPASS bup save -n compression -9 --strip $TOP/Documentation
666 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
667 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
668 COMPRESSION_9_SIZE=$(du -k -s $D | cut -f1)
670 WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]
673 WVSTART "save disjoint top-level directories"
676 # Resolve any symlinks involving the top top-level dirs.
677 real_pwd="$(realpath .)"
678 real_tmp="$(realpath /tmp/.)"
679 pwd_top="$(echo $real_pwd | awk -F "/" '{print $2}')"
680 tmp_top="$(echo $real_tmp | awk -F "/" '{print $2}')"
681 if [ "$pwd_top" = "$tmp_top" ]; then
682 echo "(running from within /$tmp_top; skipping test)"
689 tmpdir="$(mktemp -d $real_tmp/bup-test-XXXXXXX)"
690 cleanup() { set -x; rm -r "${tmpdir}"; set +x; }
694 export BUP_DIR="$TOP/buptest.tmp"
695 test -d "$BUP_DIR" && rm -r "$BUP_DIR"
698 WVPASS bup index -vu $(pwd)/$D/x "$tmpdir"
699 WVPASS bup save -t -n src $(pwd)/$D/x "$tmpdir"
701 # For now, assume that "ls -a" and "sort" use the same order.
702 WVPASSEQ "$(bup ls -a src/latest)" \
703 "$(echo -e "$pwd_top/\n$tmp_top/" | sort)"
706 WVSTART "clear-index"
708 export BUP_DIR="$TOP/$D/.bup"
715 WVPASSEQ "$(bup index -p)" "$D/foo
720 WVPASS bup index --clear
722 WVPASSEQ "$(bup index -p)" "$D/bar
726 # bup index --exclude-rx ...
729 export BUP_DIR="$TOP/buptest.tmp"
732 WVSTART "index --exclude-rx '^/foo' (root anchor)"
733 rm -rf "$D" "$BUP_DIR" buprestore.tmp
742 WVPASS bup index -u $D --exclude-rx "^$(pwd)/$D/sub1/"
743 bup save --strip -n bupdir $D
744 bup restore -C buprestore.tmp /bupdir/latest/
745 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
751 WVSTART "index --exclude-rx '/foo$' (non-dir, tail anchor)"
752 rm -rf "$D" "$BUP_DIR" buprestore.tmp
761 WVPASS bup index -u $D --exclude-rx '/foo$'
762 bup save --strip -n bupdir $D
763 bup restore -C buprestore.tmp /bupdir/latest/
764 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
771 WVSTART "index --exclude-rx '/foo/$' (dir, tail anchor)"
772 rm -rf "$D" "$BUP_DIR" buprestore.tmp
781 WVPASS bup index -u $D --exclude-rx '/foo/$'
782 bup save --strip -n bupdir $D
783 bup restore -C buprestore.tmp /bupdir/latest/
784 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
790 WVSTART "index --exclude-rx '/foo/.' (dir content)"
791 rm -rf "$D" "$BUP_DIR" buprestore.tmp
800 WVPASS bup index -u $D --exclude-rx '/foo/.'
801 bup save --strip -n bupdir $D
802 bup restore -C buprestore.tmp /bupdir/latest/
803 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
812 # bup restore --exclude-rx ...
815 export BUP_DIR="$TOP/buptest.tmp"
818 WVSTART "restore --exclude-rx '^/foo' (root anchor)"
819 rm -rf "$D" "$BUP_DIR" buprestore.tmp
828 WVPASS bup index -u $D
829 bup save --strip -n bupdir $D
830 bup restore -C buprestore.tmp --exclude-rx "^/sub1/" /bupdir/latest/
831 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
837 WVSTART "restore --exclude-rx '/foo$' (non-dir, tail anchor)"
838 rm -rf "$D" "$BUP_DIR" buprestore.tmp
847 WVPASS bup index -u $D
848 bup save --strip -n bupdir $D
849 bup restore -C buprestore.tmp --exclude-rx '/foo$' /bupdir/latest/
850 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
857 WVSTART "restore --exclude-rx '/foo/$' (dir, tail anchor)"
858 rm -rf "$D" "$BUP_DIR" buprestore.tmp
867 WVPASS bup index -u $D
868 bup save --strip -n bupdir $D
869 bup restore -C buprestore.tmp --exclude-rx '/foo/$' /bupdir/latest/
870 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
876 WVSTART "restore --exclude-rx '/foo/.' (dir content)"
877 rm -rf "$D" "$BUP_DIR" buprestore.tmp
886 WVPASS bup index -u $D
887 bup save --strip -n bupdir $D
888 bup restore -C buprestore.tmp --exclude-rx '/foo/.' /bupdir/latest/
889 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".