]> arthur.barton.de Git - bup.git/blob - t/configure-sampledata
Remove lib.sh actually-root in favor of t/root-status.
[bup.git] / t / configure-sampledata
1 #!/usr/bin/env bash
2
3 set -e -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
20             ln -sf a b
21             ln -sf b c
22             ln -sf /etc .
23         )
24         ;;
25     '--clean')
26         (
27             cd t/sampledata
28             # test -e is false for dangling symlinks.
29             if test -h b -o -e b; then rm b; fi
30             if test -h c -o -e c; then rm c; fi
31             if test -h etc -o -e etc; then rm etc; fi
32         )
33         ;;
34     *)
35         usage 1>&2; exit 1
36         ;;
37 esac