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 WVPASS bup save -r :$BUP_DIR -n r-test $D
127 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
128 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
133 WVPASS bup split -b a.tmp >taga.tmp
134 WVPASS bup split -b b.tmp >tagb.tmp
135 cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
136 WVPASSEQ $(cat taga.tmp | wc -l) 1
137 WVPASSEQ $(cat tagb.tmp | wc -l) 1
138 WVPASSEQ $(cat tagab.tmp | wc -l) 1
139 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
140 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
141 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
142 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
144 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
146 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
147 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
150 WVPASS bup midx --check -a
151 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
152 $BUP_DIR/objects/pack/*.idx
153 WVPASS bup midx --check -a
154 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
155 $BUP_DIR/objects/pack/*.idx \
156 $BUP_DIR/objects/pack/*.idx
157 WVPASS bup midx --check -a
158 all=$(echo $BUP_DIR/objects/pack/*.idx $BUP_DIR/objects/pack/*.midx)
159 WVPASS bup midx -o $BUP_DIR/objects/pack/zzz.midx $all
161 WVPASS bup midx -o $BUP_DIR/objects/pack/yyy.midx $all
163 WVPASSEQ "$(echo $BUP_DIR/objects/pack/*.midx)" \
164 "$BUP_DIR/objects/pack/yyy.midx"
166 WVPASS bup split -t t/testfile2 >tags2t.tmp
167 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
168 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
169 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
171 | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
173 WVFAIL bup ls /does-not-exist
175 WVPASS bup ls /lslr/latest
176 WVPASS bup ls /lslr/latest/
177 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
178 WVFAIL diff -u tags1.tmp tags2.tmp
180 # fanout must be different from non-fanout
181 WVFAIL diff tags2t.tmp tags2tf.tmp
182 wc -c t/testfile1 t/testfile2
183 wc -l tags1.tmp tags2.tmp
186 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
187 rm $BUP_DIR/objects/pack/bup.bloom
188 WVPASS bup bloom -k 4
189 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
190 WVPASS bup bloom -d buptest.tmp/objects/pack --ruin --force
191 WVFAIL bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
192 WVPASS bup bloom --force -k 5
193 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
196 WVPASS bup memtest -c1 -n100
197 WVPASS bup memtest -c1 -n100 --existing
200 WVPASS bup join $(cat tags1.tmp) >out1.tmp
201 WVPASS bup join <tags2.tmp >out2.tmp
202 WVPASS bup join <tags2t.tmp -o out2t.tmp
203 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
204 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
205 WVPASS diff -u t/testfile1 out1.tmp
206 WVPASS diff -u t/testfile2 out2.tmp
207 WVPASS diff -u t/testfile2 out2t.tmp
208 WVPASS diff -u t/testfile2 out2c.tmp
210 WVSTART "save/git-fsck"
213 cd "$BUP_DIR" || exit 1
216 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
217 n=$(git fsck --full --strict 2>&1 |
218 egrep -v 'dangling (commit|tree|blob)' |
221 WVPASS [ "$n" -eq 0 ]
225 force-delete buprestore.tmp
226 WVFAIL bup restore boink
230 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
231 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
232 force-delete buprestore.tmp
233 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D/"
234 touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
235 WVPASS diff -ur $D/ buprestore.tmp/
241 export BUP_DIR="$(pwd)/$tmp/bup"
243 mkdir -p $tmp/src/x/y/z
244 WVPASS bup random 8k > $tmp/src/x/y/random-1
245 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
246 WVPASS bup index -u $tmp/src
247 WVPASS bup save --strip -n foo $tmp/src
249 WVSTART "restore /foo/latest"
250 WVPASS bup restore -C $tmp/restore /foo/latest
251 WVPASS t/compare-trees $tmp/src/ $tmp/restore/latest/
253 WVSTART "restore /foo/latest/"
254 force-delete "$tmp/restore"
255 WVPASS bup restore -C $tmp/restore /foo/latest/
256 for x in $tmp/src/*; do
257 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
260 WVSTART "restore /foo/latest/."
261 force-delete "$tmp/restore"
262 WVPASS bup restore -C $tmp/restore /foo/latest/.
263 WVPASS t/compare-trees $tmp/src/ $tmp/restore/
265 WVSTART "restore /foo/latest/x"
266 force-delete "$tmp/restore"
267 WVPASS bup restore -C $tmp/restore /foo/latest/x
268 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/x/
270 WVSTART "restore /foo/latest/x/"
271 force-delete "$tmp/restore"
272 WVPASS bup restore -C $tmp/restore /foo/latest/x/
273 for x in $tmp/src/x/*; do
274 WVPASS t/compare-trees $x/ $tmp/restore/$(basename $x);
277 WVSTART "restore /foo/latest/x/."
278 force-delete "$tmp/restore"
279 WVPASS bup restore -C $tmp/restore /foo/latest/x/.
280 WVPASS t/compare-trees $tmp/src/x/ $tmp/restore/
285 WVPASS bup ftp "cat /master/latest/$TOP/$D/b" >$D/b.new
286 WVPASS bup ftp "cat /master/latest/$TOP/$D/f" >$D/f.new
287 WVPASS bup ftp "cat /master/latest/$TOP/$D/f"{,} >$D/f2.new
288 WVPASS bup ftp "cat /master/latest/$TOP/$D/a" >$D/a.new
289 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
290 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
291 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
292 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
295 WVFAIL bup tag -d v0.n 2>/dev/null
296 WVFAIL bup tag v0.n non-existant 2>/dev/null
297 WVPASSEQ "$(bup tag)" ""
298 WVPASS bup tag v0.1 master
299 WVPASSEQ "$(bup tag)" "v0.1"
300 WVPASS bup tag -d v0.1
302 # This section destroys data in the bup repository, so it is done last.
305 WVPASS bup fsck --quick
306 if bup fsck --par2-ok; then
307 WVSTART "fsck (par2)"
309 WVSTART "fsck (PAR2 IS MISSING)"
313 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
314 WVFAIL bup fsck --quick
315 WVFAIL bup fsck --quick --disable-par2
316 chmod u+w $BUP_DIR/objects/pack/*.idx
317 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
318 WVFAIL bup fsck --quick -j4
319 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
320 WVFAIL bup fsck --quick
321 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
322 if bup fsck --par2-ok; then
323 WVPASS bup fsck -r # ok because of repairs from last time
324 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
326 WVFAIL bup fsck -rvv # too many errors to be repairable
327 WVFAIL bup fsck -r # too many errors to be repairable
329 WVFAIL bup fsck --quick -r # still fails because par2 was missing
332 WVSTART "exclude-bupdir"
336 export BUP_DIR="$D/.bup"
339 WVPASS bup random 128k >$D/b
341 WVPASS bup random 512 >$D/f
342 WVPASS bup index -ux $D
343 bup save -n exclude-bupdir $D
344 WVPASSEQ "$(bup ls -a exclude-bupdir/latest/$TOP/$D/)" "a
355 export BUP_DIR="$D/.bup"
358 WVPASS bup random 128k >$D/b
360 WVPASS bup random 512 >$D/f
361 WVPASS bup random 512 >$D/j
362 WVPASS bup index -ux --exclude $D/d --exclude $D/j $D
363 bup save -n exclude $D
364 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
368 WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h \
369 --exclude $TOP/$D/j $D
370 bup save -n exclude $D
371 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
376 WVSTART "exclude-from"
379 D=exclude-fromdir.tmp
380 EXCLUDE_FILE=exclude-from.tmp
384 $D/i" > $EXCLUDE_FILE
387 export BUP_DIR="$D/.bup"
390 WVPASS bup random 128k >$D/b
392 WVPASS bup random 512 >$D/f
394 WVPASS bup random 128k > $D/i
395 WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D
396 bup save -n exclude-from $D
397 WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a
403 WVSTART "save (no index)"
406 tmp=save-no-index.tmp
409 export BUP_DIR="$(pwd)/$tmp/bup"
411 WVFAIL bup save -n nothing /
415 WVSTART "save --strip"
420 export BUP_DIR="$(pwd)/$tmp/bup"
422 mkdir -p $tmp/src/x/y/z
423 WVPASS bup random 8k > $tmp/src/x/y/random-1
424 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
425 WVPASS bup index -u $tmp/src
426 WVPASS bup save --strip -n foo $tmp/src/x/y
427 WVPASS bup restore -C $tmp/restore /foo/latest
428 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/"
431 WVSTART "save --strip-path (relative)"
436 export BUP_DIR="$(pwd)/$tmp/bup"
438 mkdir -p $tmp/src/x/y/z
439 WVPASS bup random 8k > $tmp/src/x/y/random-1
440 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
441 WVPASS bup index -u $tmp/src
442 WVPASS bup save --strip-path $tmp/src -n foo $tmp/src/x
443 WVPASS bup restore -C $tmp/restore /foo/latest
444 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/"
447 WVSTART "save --strip-path (absolute)"
452 export BUP_DIR="$(pwd)/$tmp/bup"
454 mkdir -p $tmp/src/x/y/z
455 WVPASS bup random 8k > $tmp/src/x/y/random-1
456 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
457 WVPASS bup index -u $tmp/src
458 WVPASS bup save --strip-path "$TOP" -n foo $tmp/src
459 WVPASS bup restore -C $tmp/restore /foo/latest
460 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$tmp/src/"
463 WVSTART "save --strip-path (no match)"
468 export BUP_DIR="$(pwd)/$tmp/bup"
470 mkdir -p $tmp/src/x/y/z
471 WVPASS bup random 8k > $tmp/src/x/y/random-1
472 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
473 WVPASS bup index -u $tmp/src
474 WVPASS bup save --strip-path $tmp/foo -n foo $tmp/src/x
475 WVPASS bup restore -C $tmp/restore /foo/latest
476 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/"
479 WVSTART "save --graft (empty graft points disallowed)"
484 export BUP_DIR="$(pwd)/$tmp/bup"
486 WVFAIL bup save --graft =/grafted -n graft-point-absolute $tmp
487 WVFAIL bup save --graft $TOP/$tmp= -n graft-point-absolute $tmp
490 WVSTART "save --graft /x/y=/a/b (relative paths)"
495 export BUP_DIR="$(pwd)/$tmp/bup"
497 mkdir -p $tmp/src/x/y/z
498 WVPASS bup random 8k > $tmp/src/x/y/random-1
499 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
500 WVPASS bup index -u $tmp/src
501 WVPASS bup save --graft $tmp/src=x -n foo $tmp/src
502 WVPASS bup restore -C $tmp/restore /foo/latest
503 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/x/"
506 WVSTART "save --graft /x/y=/a/b (matching structure)"
511 export BUP_DIR="$(pwd)/$tmp/bup"
513 mkdir -p $tmp/src/x/y/z
514 WVPASS bup random 8k > $tmp/src/x/y/random-1
515 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
516 WVPASS bup index -u $tmp/src
517 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=$TOP/$tmp/src/a/b" \
519 WVPASS bup restore -C $tmp/restore /foo/latest
520 WVPASS t/compare-trees $tmp/src/x/y/ \
521 "$tmp/restore/latest/$TOP/$tmp/src/a/b/"
524 WVSTART "save --graft /x/y=/a (shorter target)"
529 export BUP_DIR="$(pwd)/$tmp/bup"
531 mkdir -p $tmp/src/x/y/z
532 WVPASS bup random 8k > $tmp/src/x/y/random-1
533 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
534 WVPASS bup index -u $tmp/src
535 WVPASS bup save -v --graft "$TOP/$tmp/src/x/y=/a" -n foo $tmp/src/x/y
536 WVPASS bup restore -C $tmp/restore /foo/latest
537 WVPASS t/compare-trees $tmp/src/x/y/ "$tmp/restore/latest/a/"
540 WVSTART "save --graft /x=/a/b (longer target)"
543 export BUP_DIR="$(pwd)/$tmp/bup"
547 mkdir -p $tmp/src/x/y/z
548 WVPASS bup random 8k > $tmp/src/x/y/random-1
549 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
550 WVPASS bup index -u $tmp/src
551 WVPASS bup save -v --graft "$TOP/$tmp/src=$TOP/$tmp/src/a/b/c" \
553 WVPASS bup restore -C $tmp/restore /foo/latest
554 WVPASS t/compare-trees $tmp/src/ "$tmp/restore/latest/$TOP/$tmp/src/a/b/c/"
557 WVSTART "save --graft /x=/ (root target)"
560 export BUP_DIR="$(pwd)/$tmp/bup"
564 mkdir -p $tmp/src/x/y/z
565 WVPASS bup random 8k > $tmp/src/x/y/random-1
566 WVPASS bup random 8k > $tmp/src/x/y/z/random-2
567 WVPASS bup index -u $tmp/src
568 WVPASS bup save -v --graft "$TOP/$tmp/src/x=/" -n foo $tmp/src/x
569 WVPASS bup restore -C $tmp/restore /foo/latest
570 WVPASS t/compare-trees $tmp/src/x/ "$tmp/restore/latest/"
573 #WVSTART "save --graft /=/x/ (root source)"
574 # FIXME: Not tested for now -- will require cleverness, or caution as root.
578 INDEXFILE=tmpindexfile.tmp
582 export BUP_DIR="$D/.bup"
587 WVPASS bup index -ux $D
588 bup save --strip -n bupdir $D
589 WVPASSEQ "$(bup ls bupdir/latest/)" "a
592 WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
593 bup save --strip -n indexfile -f $INDEXFILE $D
594 WVPASSEQ "$(bup ls indexfile/latest/)" "a
598 WVSTART "import-rsnapshot"
600 export BUP_DIR="$TOP/$D/.bup"
604 mkdir -p $D/hourly.0/buptest/a
605 touch $D/hourly.0/buptest/a/b
606 mkdir -p $D/hourly.0/buptest/c/d
607 touch $D/hourly.0/buptest/c/d/e
609 WVPASS bup import-rsnapshot $D/
610 WVPASSEQ "$(bup ls buptest/latest/)" "a/
614 if [ "$(which rdiff-backup)" != "" ]; then
615 WVSTART "import-rdiff-backup"
617 export BUP_DIR="$TOP/$D/.bup"
621 mkdir $D/rdiff-backup
622 rdiff-backup $TOP/cmd $D/rdiff-backup
624 rdiff-backup $TOP/Documentation $D/rdiff-backup
625 WVPASS bup import-rdiff-backup $D/rdiff-backup import-rdiff-backup
626 WVPASSEQ "$(bup ls import-rdiff-backup/ | wc -l)" "3"
627 WVPASSEQ "$(bup ls import-rdiff-backup/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
631 WVSTART "compression"
633 export BUP_DIR="$TOP/$D/.bup"
637 WVPASS bup index $TOP/Documentation
638 WVPASS bup save -n compression -0 --strip $TOP/Documentation
639 # 'ls' on NetBSD sets -A by default when running as root, so we have to undo
640 # it by grepping out any dotfiles. (Normal OSes don't auto-set -A, but this
641 # is harmless there.)
642 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
643 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
644 COMPRESSION_0_SIZE=$(du -k -s $D | cut -f1)
647 export BUP_DIR="$TOP/$D/.bup"
651 WVPASS bup index $TOP/Documentation
652 WVPASS bup save -n compression -9 --strip $TOP/Documentation
653 WVPASSEQ "$(bup ls compression/latest/ | sort)" \
654 "$(ls $TOP/Documentation | grep -v '^\.' | sort)"
655 COMPRESSION_9_SIZE=$(du -k -s $D | cut -f1)
657 WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]
660 WVSTART "save disjoint top-level directories"
663 # Resolve any symlinks involving the top top-level dirs.
664 real_pwd="$(realpath .)"
665 real_tmp="$(realpath /tmp/.)"
666 pwd_top="$(echo $real_pwd | awk -F "/" '{print $2}')"
667 tmp_top="$(echo $real_tmp | awk -F "/" '{print $2}')"
668 if [ "$pwd_top" = "$tmp_top" ]; then
669 echo "(running from within /$tmp_top; skipping test)"
676 tmpdir="$(mktemp -d $real_tmp/bup-test-XXXXXXX)"
677 cleanup() { set -x; rm -r "${tmpdir}"; set +x; }
681 export BUP_DIR="$TOP/buptest.tmp"
682 test -d "$BUP_DIR" && rm -r "$BUP_DIR"
685 WVPASS bup index -vu $(pwd)/$D/x "$tmpdir"
686 WVPASS bup save -t -n src $(pwd)/$D/x "$tmpdir"
688 # For now, assume that "ls -a" and "sort" use the same order.
689 WVPASSEQ "$(bup ls -a src/latest)" \
690 "$(echo -e "$pwd_top/\n$tmp_top/" | sort)"
693 WVSTART "clear-index"
695 export BUP_DIR="$TOP/$D/.bup"
702 WVPASSEQ "$(bup index -p)" "$D/foo
707 WVPASS bup index --clear
709 WVPASSEQ "$(bup index -p)" "$D/bar
713 # bup index --exclude-rx ...
716 export BUP_DIR="$TOP/buptest.tmp"
719 WVSTART "index --exclude-rx '^/foo' (root anchor)"
720 rm -rf "$D" "$BUP_DIR" buprestore.tmp
729 WVPASS bup index -u $D --exclude-rx "^$(pwd)/$D/sub1/"
730 bup save --strip -n bupdir $D
731 bup restore -C buprestore.tmp /bupdir/latest/
732 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
738 WVSTART "index --exclude-rx '/foo$' (non-dir, tail anchor)"
739 rm -rf "$D" "$BUP_DIR" buprestore.tmp
748 WVPASS bup index -u $D --exclude-rx '/foo$'
749 bup save --strip -n bupdir $D
750 bup restore -C buprestore.tmp /bupdir/latest/
751 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
758 WVSTART "index --exclude-rx '/foo/$' (dir, tail anchor)"
759 rm -rf "$D" "$BUP_DIR" buprestore.tmp
768 WVPASS bup index -u $D --exclude-rx '/foo/$'
769 bup save --strip -n bupdir $D
770 bup restore -C buprestore.tmp /bupdir/latest/
771 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
777 WVSTART "index --exclude-rx '/foo/.' (dir content)"
778 rm -rf "$D" "$BUP_DIR" buprestore.tmp
787 WVPASS bup index -u $D --exclude-rx '/foo/.'
788 bup save --strip -n bupdir $D
789 bup restore -C buprestore.tmp /bupdir/latest/
790 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
799 # bup restore --exclude-rx ...
802 export BUP_DIR="$TOP/buptest.tmp"
805 WVSTART "restore --exclude-rx '^/foo' (root anchor)"
806 rm -rf "$D" "$BUP_DIR" buprestore.tmp
815 WVPASS bup index -u $D
816 bup save --strip -n bupdir $D
817 bup restore -C buprestore.tmp --exclude-rx "^/sub1/" /bupdir/latest/
818 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
824 WVSTART "restore --exclude-rx '/foo$' (non-dir, tail anchor)"
825 rm -rf "$D" "$BUP_DIR" buprestore.tmp
834 WVPASS bup index -u $D
835 bup save --strip -n bupdir $D
836 bup restore -C buprestore.tmp --exclude-rx '/foo$' /bupdir/latest/
837 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
844 WVSTART "restore --exclude-rx '/foo/$' (dir, tail anchor)"
845 rm -rf "$D" "$BUP_DIR" buprestore.tmp
854 WVPASS bup index -u $D
855 bup save --strip -n bupdir $D
856 bup restore -C buprestore.tmp --exclude-rx '/foo/$' /bupdir/latest/
857 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".
863 WVSTART "restore --exclude-rx '/foo/.' (dir content)"
864 rm -rf "$D" "$BUP_DIR" buprestore.tmp
873 WVPASS bup index -u $D
874 bup save --strip -n bupdir $D
875 bup restore -C buprestore.tmp --exclude-rx '/foo/.' /bupdir/latest/
876 WVPASSEQ "$(cd buprestore.tmp && find . | sort)" ".