5 # NOTE: any relevant changes to var/ must be accompanied by an
6 # increment to the revision.
11 top="$(pwd)" || exit $?
15 echo 'Usage: t/configure-sampledata [--setup | --clean | --revision]'
18 if test "$#" -ne 1; then
24 cd t/sampledata || exit $?
25 if test -e var; then rm -r var || exit $?; fi
26 # Remove legacy content (before everything moved to var/).
27 # test -e is false for dangling symlinks.
28 if test -h b -o -e b; then rm b || exit $?; fi
29 if test -h c -o -e c; then rm c || exit $?; fi
30 if test -h abs-symlink -o -e abs-symlink; then
31 rm abs-symlink || exit $?
39 mkdir -p t/sampledata/var/rev || exit $?
40 cd t/sampledata/var || exit $?
43 ln -sf "$(pwd)/abs-symlink-target" abs-symlink || exit $?
44 mkdir -p cmd doc lib/bup || exit $?
45 cp -a "$top"/cmd/*.py cmd/ || exit $?
46 cp -a "$top"/Documentation/*.md doc/ || exit $?
47 cp -a "$top"/lib/bup/*.py lib/bup || exit $?
48 # The "v" ensures that if "configure-sampledata
49 # --revision" and/or the setup above fails somehow,
50 # callers like make will be looking for a file that won't
52 touch rev/v$revision || exit $?
59 echo "$revision" || exit $?