]> arthur.barton.de Git - bup.git/blob - t/configure-sampledata
Use *native* type sizes in file attr guard
[bup.git] / t / configure-sampledata
1 #!/usr/bin/env bash
2
3 set -o pipefail
4
5 top=$(pwd)
6
7 usage()
8 {
9     echo 'Usage: t/configure-sampledata [--setup | --clean]'
10 }
11
12 if test "$#" -ne 1; then
13     usage 1>&2; exit 1
14 fi
15
16 case "$1" in
17     '--setup')
18         (
19             cd t/sampledata || exit $?
20             ln -sf a b || exit $?
21             ln -sf b c || exit $?
22             ln -sf "$(pwd)/abs-symlink-target" abs-symlink || exit $?
23         ) || exit $?
24         ;;
25     '--clean')
26         (
27             cd t/sampledata || exit $?
28             # test -e is false for dangling symlinks.
29             if test -h b -o -e b; then rm b || exit $?; fi
30             if test -h c -o -e c; then rm c || exit $?; fi
31             if test -h etc -o -e etc; then rm etc || exit $?; fi
32         )
33         ;;
34     *)
35         usage 1>&2; exit 1
36         ;;
37 esac