Lines Matching +full:in +full:- +full:tree
7 # Redistribution and use in source and binary forms, with or without
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
19 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 # Various regression tests to test the -I flag to the 'update' command.
36 echo "Usage: ignore.sh [-s script] [-w workdir]"
43 case $option in
56 shift $((OPTIND - 1))
57 if [ $# -ne 0 ]; then
72 rm -rf $OLD $NEW $TEST $CONFLICTS
73 mkdir -p $OLD $NEW $TEST
75 for i in $OLD $NEW $TEST; do
76 mkdir -p $i/tree
79 # tree: Test three different cases (add, modify, remove) that all
80 # match the tree/* glob.
81 echo "foo" > $NEW/tree/add
82 for i in $OLD $TEST; do
83 echo "old" > $i/tree/modify
85 echo "new" > $NEW/tree/modify
86 for i in $OLD $TEST; do
87 echo "old" > $i/tree/remove
90 # rmdir: Remove a whole tree.
91 for i in $OLD $TEST; do
97 # $1 - relative path to file that should be missing from TEST
100 if [ -e $TEST/$1 -o -L $TEST/$1 ]; then
106 # $1 - relative path to file that should be present in TEST
109 if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then
115 # $1 - relative path to file that should be a directory in TEST
118 if ! [ -d $TEST/$1 ]; then
124 # $1 - relative path to regular file that should be present in TEST
125 # $2 - optional string that should match file contents
126 # $3 - optional MD5 of the flie contents, overrides $2 if present
131 if ! [ -f $TEST/$1 ]; then
134 elif [ $# -eq 2 ]; then
140 elif [ $# -eq 3 ]; then
141 sum=`md5 -q $TEST/$1`
149 # $1 - relative path to a regular file that should have a conflict
150 # $2 - optional MD5 of the conflict file contents
155 if ! [ -f $CONFLICTS/$1 ]; then
158 elif [ $# -gt 1 ]; then
159 sum=`md5 -q $CONFLICTS/$1`
167 # $1 - relative path to a regular file that should not have a conflict
170 if [ -f $CONFLICTS/$1 ]; then
176 if [ `id -u` -ne 0 ]; then
181 if [ -r /etc/etcupdate.conf ]; then
189 $COMMAND -r -d $WORKDIR -D $TEST > $WORKDIR/test.out
193 D /tree/remove
195 U /tree/modify
196 A /tree/add
200 diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \
203 missing /tree/remove
204 file /tree/modify "new"
205 file /tree/add "foo"
209 # Now test with -I '/tree/*'. This should preserve the /tree files.
213 $COMMAND -r -I '/tree/*' -d $WORKDIR -D $TEST > $WORKDIR/test1.out
220 echo "Differences for -I '/tree/*':"
221 diff -u -L "correct" $WORKDIR/correct1.out -L "test" $WORKDIR/test1.out \
224 file /tree/remove "old"
225 file /tree/modify "old"
226 missing /tree/add
234 $COMMAND -r -I '/tree/*' -I '/rmdir*' -d $WORKDIR -D $TEST > \
240 echo "Differences for -I '/tree/*' -I '/rmdir*':"
242 diff -u -L "correct" $WORKDIR/correct2.out -L "test" $WORKDIR/test2.out \
245 file /tree/remove "old"
246 file /tree/modify "old"
247 missing /tree/add
252 # tests putting two patterns into a single -I argument.
256 $COMMAND -r -I '/tree/* /rmdir/*' -d $WORKDIR -D $TEST > \
261 Non-empty directory remains: /rmdir
264 echo "Differences for -I '/tree/* /rmdir/*':"
266 diff -u -L "correct" $WORKDIR/correct3.out -L "test" $WORKDIR/test3.out \
269 file /tree/remove "old"
270 file /tree/modify "old"
271 missing /tree/add