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 WVPASSEQ "$tree1" "$tree2"
130 WVPASSEQ "$(bup index -s / | grep ^D)" ""
131 tree3=$(bup save -t /) || WVFAIL
132 WVPASSEQ "$tree1" "$tree3"
133 WVPASS bup save -r :$BUP_DIR -n r-test $D
134 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
135 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
140 WVPASS bup split -b a.tmp >taga.tmp
141 WVPASS bup split -b b.tmp >tagb.tmp
142 cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
143 WVPASSEQ $(cat taga.tmp | wc -l) 1
144 WVPASSEQ $(cat tagb.tmp | wc -l) 1
145 WVPASSEQ $(cat tagab.tmp | wc -l) 1
146 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
147 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
148 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
149 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
151 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
153 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
154 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
157 WVPASS bup midx --check -a
158 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
159 $BUP_DIR/objects/pack/*.idx
160 WVPASS bup midx --check -a
161 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
162 $BUP_DIR/objects/pack/*.idx \
163 $BUP_DIR/objects/pack/*.idx
164 WVPASS bup midx --check -a
165 all=$(echo $BUP_DIR/objects/pack/*.idx $BUP_DIR/objects/pack/*.midx)
166 WVPASS bup midx -o $BUP_DIR/objects/pack/zzz.midx $all
168 WVPASS bup midx -o $BUP_DIR/objects/pack/yyy.midx $all
170 WVPASSEQ "$(echo $BUP_DIR/objects/pack/*.midx)" \
171 "$BUP_DIR/objects/pack/yyy.midx"
173 WVPASS bup split -t t/testfile2 >tags2t.tmp
174 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
175 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
176 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
178 | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
180 WVFAIL bup ls /does-not-exist
182 WVPASS bup ls /lslr/latest
183 WVPASS bup ls /lslr/latest/
184 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
185 WVFAIL diff -u tags1.tmp tags2.tmp
187 # fanout must be different from non-fanout
188 WVFAIL diff tags2t.tmp tags2tf.tmp
189 wc -c t/testfile1 t/testfile2
190 wc -l tags1.tmp tags2.tmp
193 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
194 rm $BUP_DIR/objects/pack/bup.bloom
195 WVPASS bup bloom -k 4
196 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
197 WVPASS bup bloom -d buptest.tmp/objects/pack --ruin --force
198 WVFAIL bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
199 WVPASS bup bloom --force -k 5
200 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
203 WVPASS bup memtest -c1 -n100
204 WVPASS bup memtest -c1 -n100 --existing
207 WVPASS bup join $(cat tags1.tmp) >out1.tmp
208 WVPASS bup join <tags2.tmp >out2.tmp
209 WVPASS bup join <tags2t.tmp -o out2t.tmp
210 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
211 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
212 WVPASS diff -u t/testfile1 out1.tmp
213 WVPASS diff -u t/testfile2 out2.tmp
214 WVPASS diff -u t/testfile2 out2t.tmp
215 WVPASS diff -u t/testfile2 out2c.tmp
217 WVSTART "save/git-fsck"
220 cd "$BUP_DIR" || exit 1
223 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
224 n=$(git fsck --full --strict 2>&1 |
225 egrep -v 'dangling (commit|tree|blob)' |
228 WVPASS [ "$n" -eq 0 ]
232 force-delete buprestore.tmp
233 WVFAIL bup restore boink
237 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
238 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
239 force-delete buprestore.tmp
240 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D/"
241 touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
242 WVPASS diff -ur $D/ buprestore.tmp/
248 export BUP_DIR="$(pwd)/$tmp/bup"
250 mkdir -p $tmp/src/x/y/z
251 WVPASS bup random 8k > $tmp/src/x/y/random-1
252 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
253 WVPASS bup index -u $tmp/src
254 WVPASS bup save --strip -n foo $tmp/src
256 WVSTART "restore /foo/latest"
257 WVPASS bup restore -C $tmp/restore /foo/latest
258 WVPASS t/compare-trees $tmp/src/ $tmp/restore/latest/
260 WVSTART "restore /foo/latest/"
261 force-delete "$tmp/restore"
262 WVPASS bup restore -C $tmp/restore /foo/latest/
263 for x in $tmp/src/*; do
264 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
267 WVSTART "restore /foo/latest/."
268 force-delete "$tmp/restore"
269 WVPASS bup restore -C $tmp/restore /foo/latest/.
270 WVPASS t/compare-trees $tmp/src/ $tmp/restore/
272 WVSTART "restore /foo/latest/x"
273 force-delete "$tmp/restore"
274 WVPASS bup restore -C $tmp/restore /foo/latest/x
275 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/x/
277 WVSTART "restore /foo/latest/x/"
278 force-delete "$tmp/restore"
279 WVPASS bup restore -C $tmp/restore /foo/latest/x/
280 for x in $tmp/src/x/*; do
281 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
284 WVSTART "restore /foo/latest/x/."
285 force-delete "$tmp/restore"
286 WVPASS bup restore -C $tmp/restore /foo/latest/x/.
287 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/
292 WVPASS bup ftp "cat /master/latest/$TOP/$D/b" >$D/b.new
293 WVPASS bup ftp "cat /master/latest/$TOP/$D/f" >$D/f.new
294 WVPASS bup ftp "cat /master/latest/$TOP/$D/f"{,} >$D/f2.new
295 WVPASS bup ftp "cat /master/latest/$TOP/$D/a" >$D/a.new
296 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
297 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
298 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
299 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
302 WVFAIL bup tag -d v0.n 2>/dev/null
303 WVFAIL bup tag v0.n non-existant 2>/dev/null
304 WVPASSEQ "$(bup tag)" ""
305 WVPASS bup tag v0.1 master
306 WVPASSEQ "$(bup tag)" "v0.1"
307 WVPASS bup tag -d v0.1
309 # This section destroys data in the bup repository, so it is done last.
312 WVPASS bup fsck --quick
313 if bup fsck --par2-ok; then
314 WVSTART "fsck (par2)"
316 WVSTART "fsck (PAR2 IS MISSING)"
320 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
321 WVFAIL bup fsck --quick
322 WVFAIL bup fsck --quick --disable-par2
323 chmod u+w $BUP_DIR/objects/pack/*.idx
324 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
325 WVFAIL bup fsck --quick -j4
326 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
327 WVFAIL bup fsck --quick
328 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
329 if bup fsck --par2-ok; then
330 WVPASS bup fsck -r # ok because of repairs from last time
331 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
333 WVFAIL bup fsck -rvv # too many errors to be repairable
334 WVFAIL bup fsck -r # too many errors to be repairable
336 WVFAIL bup fsck --quick -r # still fails because par2 was missing
339 WVSTART "exclude-bupdir"
343 export BUP_DIR="$D/.bup"
346 WVPASS bup random 128k >$D/b
348 WVPASS bup random 512 >$D/f
349 WVPASS bup index -ux $D
350 bup save -n exclude-bupdir $D
351 WVPASSEQ "$(bup ls -a exclude-bupdir/latest/$TOP/$D/)" "a
362 export BUP_DIR="$D/.bup"
365 WVPASS bup random 128k >$D/b
367 WVPASS bup random 512 >$D/f
368 WVPASS bup random 512 >$D/j
369 WVPASS bup index -ux --exclude $D/d --exclude $D/j $D
370 bup save -n exclude $D
371 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
375 WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h \
376 --exclude $TOP/$D/j $D
377 bup save -n exclude $D
378 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
383 WVSTART "exclude-from"
386 D=exclude-fromdir.tmp
387 EXCLUDE_FILE=exclude-from.tmp
391 $D/i" > $EXCLUDE_FILE
394 export BUP_DIR="$D/.bup"
397 WVPASS bup random 128k >$D/b
399 WVPASS bup random 512 >$D/f
401 WVPASS bup random 128k > $D/i
402 WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D
403 bup save -n exclude-from $D
404 WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a
410 WVSTART "save (no index)"
413 tmp=save-no-index.tmp
416 export BUP_DIR="$(pwd)/$tmp/bup"
418 WVFAIL bup save -n nothing /
422 WVSTART "save --strip"
427 export BUP_DIR="$(pwd)/$tmp/bup"
429 mkdir -p $tmp/src/x/y/z
430 WVPASS bup random 8k > $tmp/src/x/y/random-1
431 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
432 WVPASS bup index -u $tmp/src
433 WVPASS bup save --strip -n foo $tmp/src/x/y
434 WVPASS bup restore -C $tmp/restore /foo/latest
435 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/"
438 WVSTART "save --strip-path (relative)"
443 export BUP_DIR="$(pwd)/$tmp/bup"
445 mkdir -p $tmp/src/x/y/z
446 WVPASS bup random 8k > $tmp/src/x/y/random-1
447 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
448 WVPASS bup index -u $tmp/src
449 WVPASS bup save --strip-path $tmp/src -n foo $tmp/src/x
450 WVPASS bup restore -C $tmp/restore /foo/latest
451 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/"
454 WVSTART "save --strip-path (absolute)"
459 export BUP_DIR="$(pwd)/$tmp/bup"
461 mkdir -p $tmp/src/x/y/z
462 WVPASS bup random 8k > $tmp/src/x/y/random-1
463 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
464 WVPASS bup index -u $tmp/src
465 WVPASS bup save --strip-path "$TOP" -n foo $tmp/src
466 WVPASS bup restore -C $tmp/restore /foo/latest
467 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$tmp/src/"
470 WVSTART "save --strip-path (no match)"
475 export BUP_DIR="$(pwd)/$tmp/bup"
477 mkdir -p $tmp/src/x/y/z
478 WVPASS bup random 8k > $tmp/src/x/y/random-1
479 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
480 WVPASS bup index -u $tmp/src
481 WVPASS bup save --strip-path $tmp/foo -n foo $tmp/src/x
482 WVPASS bup restore -C $tmp/restore /foo/latest
483 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/"
486 WVSTART "save --graft (empty graft points disallowed)"
491 export BUP_DIR="$(pwd)/$tmp/bup"
493 WVFAIL bup save --graft =/grafted -n graft-point-absolute $tmp
494 WVFAIL bup save --graft $TOP/$tmp= -n graft-point-absolute $tmp
497 WVSTART "save --graft /x/y=/a/b (relative paths)"
502 export BUP_DIR="$(pwd)/$tmp/bup"
504 mkdir -p $tmp/src/x/y/z
505 WVPASS bup random 8k > $tmp/src/x/y/random-1
506 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
507 WVPASS bup index -u $tmp/src
508 WVPASS bup save --graft $tmp/src=x -n foo $tmp/src
509 WVPASS bup restore -C $tmp/restore /foo/latest
510 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/x/"
513 WVSTART "save --graft /x/y=/a/b (matching structure)"
518 export BUP_DIR="$(pwd)/$tmp/bup"
520 mkdir -p $tmp/src/x/y/z
521 WVPASS bup random 8k > $tmp/src/x/y/random-1
522 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
523 WVPASS bup index -u $tmp/src
524 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=$TOP/$tmp/src/a/b" \
526 WVPASS bup restore -C $tmp/restore /foo/latest
527 WVPASS t/compare-trees $tmp/src/x/y/ \
528 "$tmp/restore/latest/$TOP/$tmp/src/a/b/"
531 WVSTART "save --graft /x/y=/a (shorter target)"
536 export BUP_DIR="$(pwd)/$tmp/bup"
538 mkdir -p $tmp/src/x/y/z
539 WVPASS bup random 8k > $tmp/src/x/y/random-1
540 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
541 WVPASS bup index -u $tmp/src
542 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=/a" -n foo $tmp/src/x/y
543 WVPASS bup restore -C $tmp/restore /foo/latest
544 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/a/"
547 WVSTART "save --graft /x=/a/b (longer target)"
550 export BUP_DIR="$(pwd)/$tmp/bup"
554 mkdir -p $tmp/src/x/y/z
555 WVPASS bup random 8k > $tmp/src/x/y/random-1
556 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
557 WVPASS bup index -u $tmp/src
558 WVPASS bup save -v --graft "$TOP/$tmp/src=$TOP/$tmp/src/a/b/c" \
560 WVPASS bup restore -C $tmp/restore /foo/latest
561 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/a/b/c/"
564 WVSTART "save --graft /x=/ (root target)"
567 export BUP_DIR="$(pwd)/$tmp/bup"
571 mkdir -p $tmp/src/x/y/z
572 WVPASS bup random 8k > $tmp/src/x/y/random-1
573 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
574 WVPASS bup index -u $tmp/src
575 WVPASS bup save -v --graft "$TOP/$tmp/src/x=/" -n foo $tmp/src/x
576 WVPASS bup restore -C $tmp/restore /foo/latest
577 WVPASS t/compare-trees $tmp/src/x/ "$tmp/restore/latest/"
580 #WVSTART "save --graft /=/x/ (root source)"
581 # FIXME: Not tested for now -- will require cleverness, or caution as root.
585 INDEXFILE=tmpindexfile.tmp
589 export BUP_DIR="$D/.bup"
594 WVPASS bup index -ux $D
595 bup save --strip -n bupdir $D
596 WVPASSEQ "$(bup ls bupdir/latest/)" "a
599 WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
600 bup save --strip -n indexfile -f $INDEXFILE $D
601 WVPASSEQ "$(bup ls indexfile/latest/)" "a
605 WVSTART "import-rsnapshot"
607 export BUP_DIR="$TOP/$D/.bup"
611 mkdir -p $D/hourly.0/buptest/a
612 touch $D/hourly.0/buptest/a/b
613 mkdir -p $D/hourly.0/buptest/c/d
614 touch $D/hourly.0/buptest/c/d/e
616 WVPASS bup import-rsnapshot $D/
617 WVPASSEQ "$(bup ls buptest/latest/)" "a/
621 if [ "$(which rdiff-backup)" != "" ]; then
622 WVSTART "import-rdiff-backup"
624 export BUP_DIR="$TOP/$D/.bup"
628 mkdir $D/rdiff-backup
629 rdiff-backup $TOP/cmd $D/rdiff-backup
631 rdiff-backup $TOP/Documentation $D/rdiff-backup
632 WVPASS bup import-rdiff-backup $D/rdiff-backup import-rdiff-backup
633 WVPASSEQ "$(bup ls import-rdiff-backup/ | wc -l)" "3"
634 WVPASSEQ "$(bup ls import-rdiff-backup/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
638 WVSTART "compression"
640 export BUP_DIR="$TOP/$D/.bup"
644 WVPASS bup index $TOP/Documentation
645 WVPASS bup save -n compression -0 --strip $TOP/Documentation
646 # 'ls' on NetBSD sets -A by default when running as root, so we have to undo
647 # it by grepping out any dotfiles. (Normal OSes don't auto-set -A, but this
648 # is harmless there.)
649 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
650 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
651 COMPRESSION_0_SIZE=$(du -k -s $D | cut -f1)
654 export BUP_DIR="$TOP/$D/.bup"
658 WVPASS bup index $TOP/Documentation
659 WVPASS bup save -n compression -9 --strip $TOP/Documentation
660 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
661 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
662 COMPRESSION_9_SIZE=$(du -k -s $D | cut -f1)
664 WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]
667 WVSTART "save disjoint top-level directories"
670 top_dir="$(echo $(pwd) | awk -F "/" '{print $2}')"
671 if [ "$top_dir" == tmp ]; then
672 echo "(running from within /tmp; skipping test)"
679 tmpdir="$(mktemp -d /tmp/bup-test-XXXXXXX)"
680 cleanup() { set -x; rm -r "${tmpdir}"; set +x; }
684 export BUP_DIR="$TOP/buptest.tmp"
685 test -d "$BUP_DIR" && rm -r "$BUP_DIR"
688 WVPASS bup index -vu $(pwd)/$D/x "$tmpdir"
689 WVPASS bup save -t -n src $(pwd)/$D/x "$tmpdir"
690 # For now, assume that "ls -a" and "sort" use the same order.
691 WVPASSEQ "$(bup ls -a src/latest)" "$(echo -e "$top_dir/\ntmp/" | sort)"
694 WVSTART "clear-index"
696 export BUP_DIR="$TOP/$D/.bup"
703 WVPASSEQ "$(bup index -p)" "$D/foo
708 WVPASS bup index --clear
710 WVPASSEQ "$(bup index -p)" "$D/bar
714 # bup index --exclude-rx ...
717 export BUP_DIR="$TOP/buptest.tmp"
720 WVSTART "index --exclude-rx '^/foo' (root anchor)"
721 rm -rf "$D" "$BUP_DIR" buprestore.tmp
730 WVPASS bup index -u $D --exclude-rx "^$(pwd)/$D/sub1/"
731 bup save --strip -n bupdir $D
732 bup restore -C buprestore.tmp /bupdir/latest/
733 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
739 WVSTART "index --exclude-rx '/foo$' (non-dir, tail anchor)"
740 rm -rf "$D" "$BUP_DIR" buprestore.tmp
749 WVPASS bup index -u $D --exclude-rx '/foo$'
750 bup save --strip -n bupdir $D
751 bup restore -C buprestore.tmp /bupdir/latest/
752 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
759 WVSTART "index --exclude-rx '/foo/$' (dir, tail anchor)"
760 rm -rf "$D" "$BUP_DIR" buprestore.tmp
769 WVPASS bup index -u $D --exclude-rx '/foo/$'
770 bup save --strip -n bupdir $D
771 bup restore -C buprestore.tmp /bupdir/latest/
772 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
778 WVSTART "index --exclude-rx '/foo/.' (dir content)"
779 rm -rf "$D" "$BUP_DIR" buprestore.tmp
788 WVPASS bup index -u $D --exclude-rx '/foo/.'
789 bup save --strip -n bupdir $D
790 bup restore -C buprestore.tmp /bupdir/latest/
791 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".