5 # NOTE: any relevant changes to var/ must be accompanied by an
6 # increment to the revision.
10 top="$(pwd)" || exit $?
14 echo 'Usage: t/configure-sampledata [--setup | --clean | --revision]'
17 if test "$#" -ne 1; then
24 # test -e is false for dangling symlinks.
25 if test -h "$p" -o -e "$p"; then rm "$p" || exit $?; fi
31 cd t/sampledata || exit $?
32 if test -e var; then rm -r var || exit $?; fi
33 # Remove legacy content (before everything moved to var/).
34 rm_symlinks abs-symlink b c etc
41 mkdir -p t/sampledata/var/rev || exit $?
42 cd t/sampledata/var || exit $?
45 ln -sf "$(pwd)/abs-symlink-target" abs-symlink || exit $?
47 mkdir -p cmd doc lib/bup || exit $?
48 cp -pP "$top"/cmd/*.py cmd/ || exit $?
49 cp -pP "$top"/Documentation/*.md doc/ || exit $?
50 cp -pP "$top"/lib/bup/*.py lib/bup || exit $?
51 mkdir path-zoo || exit $?
52 if test "$BUP_TEST_RANDOMIZED_SAMPLEDATA_PATHS"; then
53 "$top"/t/make-random-paths 3000 path-zoo || exit $?
55 # The "v" ensures that if "configure-sampledata
56 # --revision" and/or the setup above fails somehow,
57 # callers like make will be looking for a file that won't
59 touch rev/v$revision || exit $?
66 echo "$revision" || exit $?