aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/vdb_merger_TEST_setup.sh
blob: f49dfa8b801cc83c51168d3b634f52f491bcdb6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
# vim: set ft=sh sw=4 sts=4 et :

mkdir vdb_merger_TEST_dir || exit 2
cd vdb_merger_TEST_dir || exit 3
mkdir CONTENTS || exit 4


mkdir -p config_protect_dir/{image,root} || exit 4

cd config_protect_dir/image

echo foo >protected_file
echo foo >unprotected_file
echo foo >protected_file_not_really

mkdir protected_dir
echo foo >protected_dir/protected_file
echo foo >protected_dir/unprotected_file
echo foo >protected_dir/unprotected_file_not_really

echo foo >protected_dir/protected_file_already_needs_update
echo foo >protected_dir/unchanged_protected_file
echo foo >protected_dir/protected_file_same_as_existing_update

mkdir protected_dir/unprotected_dir
echo foo >protected_dir/unprotected_dir/unprotected_file

mkdir protected_dir/unprotected_dir_not_really
echo foo >protected_dir/unprotected_dir_not_really/protected_file

mkdir protected_dir_not_really
echo foo >protected_dir_not_really/unprotected_file

cd ../root

echo bar >protected_file
echo bar >unprotected_file
echo bar >protected_file_not_really

mkdir protected_dir
echo bar >protected_dir/protected_file
echo bar >protected_dir/unprotected_file
echo bar >protected_dir/unprotected_file_not_really

echo bar >protected_dir/protected_file_already_needs_update
echo baz >protected_dir/._cfg0000_protected_file_already_needs_update
echo foo >protected_dir/unchanged_protected_file
echo bar >protected_dir/protected_file_same_as_existing_update
echo foo >protected_dir/._cfg0000_protected_file_same_as_existing_update

mkdir protected_dir/unprotected_dir
echo bar >protected_dir/unprotected_dir/unprotected_file

mkdir protected_dir/unprotected_dir_not_really
echo bar >protected_dir/unprotected_dir_not_really/protected_file

mkdir protected_dir_not_really
echo bar >protected_dir_not_really/unprotected_file

cd ../..


mkdir -p file_newline_dir/{image,root} || exit 4
touch file_newline_dir/image/"file
newline" || exit 5

mkdir -p dir_newline_dir/{image,root} || exit 4
mkdir dir_newline_dir/image/"dir
newline" || exit 5

mkdir -p sym_newline_dir/{image,root} || exit 4
ln -s foo sym_newline_dir/image/"sym
newline" || exit 5

mkdir -p sym_target_newline_dir/{image,root} || exit 4
ln -s "foo
bar" sym_target_newline_dir/image/sym_target_newline || exit 5

mkdir -p sym_arrow_dir/{image,root} || exit 4
ln -s bar sym_arrow_dir/image/"sym -> arrow" || exit 5

mkdir -p sym_arrow2_dir/{image,root} || exit 4
mkdir sym_arrow2_dir/image/"dir -> ectory" || exit 5
ln -s bar sym_arrow2_dir/image/"dir -> ectory/sym" || exit 5


for d in *_dir; do
    ln -s ${d} ${d%_dir}
done