Updated the exclude test to test merge files.
authorWayne Davison <wayned@samba.org>
Sat, 22 May 2004 19:36:36 +0000 (19:36 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 22 May 2004 19:36:36 +0000 (19:36 +0000)
filter.diff

index e2f6724..e910e5e 100644 (file)
@@ -30,7 +30,7 @@ for the current dir because its name contained a slash.
 ..wayne..
 
 --- exclude.c  22 May 2004 05:32:20 -0000      1.82
 ..wayne..
 
 --- exclude.c  22 May 2004 05:32:20 -0000      1.82
-+++ exclude.c  22 May 2004 06:02:55 -0000
++++ exclude.c  22 May 2004 19:32:12 -0000
 @@ -30,13 +30,56 @@ extern int verbose;
  extern int eol_nulls;
  extern int list_only;
 @@ -30,13 +30,56 @@ extern int verbose;
  extern int eol_nulls;
  extern int list_only;
@@ -398,7 +398,7 @@ for the current dir because its name contained a slash.
                    XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
  
 --- flist.c    21 May 2004 23:22:14 -0000      1.225
                    XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
  
 --- flist.c    21 May 2004 23:22:14 -0000      1.225
-+++ flist.c    22 May 2004 06:02:55 -0000
++++ flist.c    22 May 2004 19:32:12 -0000
 @@ -39,8 +39,6 @@ extern int module_id;
  extern int ignore_errors;
  extern int numeric_ids;
 @@ -39,8 +39,6 @@ extern int module_id;
  extern int ignore_errors;
  extern int numeric_ids;
@@ -491,7 +491,7 @@ for the current dir because its name contained a slash.
  }
  
 --- rsync.h    16 May 2004 07:28:24 -0000      1.204
  }
  
 --- rsync.h    16 May 2004 07:28:24 -0000      1.204
-+++ rsync.h    22 May 2004 06:02:56 -0000
++++ rsync.h    22 May 2004 19:32:13 -0000
 @@ -496,11 +496,16 @@ struct map_struct {
  #define MATCHFLG_INCLUDE      (1<<4) /* this is an include, not an exclude */
  #define MATCHFLG_DIRECTORY    (1<<5) /* this matches only directories */
 @@ -496,11 +496,16 @@ struct map_struct {
  #define MATCHFLG_INCLUDE      (1<<4) /* this is an include, not an exclude */
  #define MATCHFLG_DIRECTORY    (1<<5) /* this matches only directories */
@@ -511,7 +511,7 @@ for the current dir because its name contained a slash.
  
  struct exclude_list_struct {
 --- rsync.yo   21 May 2004 09:44:32 -0000      1.170
  
  struct exclude_list_struct {
 --- rsync.yo   21 May 2004 09:44:32 -0000      1.170
-+++ rsync.yo   22 May 2004 06:02:57 -0000
++++ rsync.yo   22 May 2004 19:32:13 -0000
 @@ -1090,6 +1090,74 @@ itemize(
    it would be excluded by the "*")
  )
 @@ -1090,6 +1090,74 @@ itemize(
    it would be excluded by the "*")
  )
@@ -587,3 +587,78 @@ for the current dir because its name contained a slash.
  manpagesection(BATCH MODE)
  
  bf(Note:) Batch mode should be considered experimental in this version
  manpagesection(BATCH MODE)
  
  bf(Note:) Batch mode should be considered experimental in this version
+--- testsuite/exclude.test     22 May 2004 19:29:53 -0000      1.7
++++ testsuite/exclude.test     22 May 2004 19:32:13 -0000
+@@ -24,19 +24,47 @@ echo home-cvs-exclude >"$scratchdir"/.cv
+ makepath "$fromdir/foo/down/to/you"
+ makepath "$fromdir/bar/down/to/foo/too"
+ makepath "$fromdir/mid/for/foo/and/that/is/who"
++cat <<EOT >"$fromdir/.excl"
++.excl
++*.bak
++*.old
++*.junk
++EOT
+ echo kept >"$fromdir/foo/file1"
+ echo removed >"$fromdir/foo/file2"
+ echo cvsout >"$fromdir/foo/file2.old"
++cat <<EOT >"$fromdir/foo/.excl"
+++ .excl
++- file1
++EOT
++cat <<EOT >"$fromdir/bar/.excl"
++home-cvs-exclude
++. .excl2
+++ to
++EOT
+ echo cvsout >"$fromdir/bar/down/to/home-cvs-exclude"
++cat <<EOT >"$fromdir/bar/down/to/.excl2"
++.excl2
++EOT
+ echo keeper >"$fromdir/bar/down/to/foo/file1"
+ echo cvsout >"$fromdir/bar/down/to/foo/file1.bak"
+ echo gone >"$fromdir/bar/down/to/foo/file3"
+ echo lost >"$fromdir/bar/down/to/foo/file4"
+ echo cvsout >"$fromdir/bar/down/to/foo/file4.junk"
+ echo smashed >"$fromdir/bar/down/to/foo/to"
++cat <<EOT >"$fromdir/bar/down/to/foo/.excl2"
+++ *.junk
++EOT
++# This one should be ineffectual
++cat <<EOT >"$fromdir/mid/.excl2"
++extra
++EOT
+ echo cvsout >"$fromdir/mid/one-in-one-out"
+ echo one-in-one-out >"$fromdir/mid/.cvsignore"
+ echo cvsin >"$fromdir/mid/one-for-all"
++cat <<EOT >"$fromdir/mid/.excl"
++. .cvsignore
++EOT
+ echo cvsin >"$fromdir/mid/for/one-in-one-out"
+ echo expunged >"$fromdir/mid/for/foo/extra"
+ echo retained >"$fromdir/mid/for/foo/keep"
+@@ -97,5 +125,24 @@ $RSYNC -av --existing --include='*/' --e
+ checkit "$RSYNC -avvC --delete-excluded --exclude-from=$excl \
+     \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
++# Modify the chk dir for our merge-exclude test and then tweak the dir times.
++
++rm "$chkdir"/.excl
++rm "$chkdir"/foo/file1
++rm "$chkdir"/bar/.excl
++rm "$chkdir"/bar/down/to/.excl2
++rm "$chkdir"/bar/down/to/foo/.excl2
++rm "$chkdir"/mid/.excl
++cp -p "$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
++cp -p "$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
++
++$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/"
++
++# Now, test if rsync excludes the same files, this time with a merge-exclude
++# file.
++
++checkit "$RSYNC -avv --exclude='. .excl' --delete-excluded --exclude-from=$excl \
++    \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
++
+ # The script would have aborted on error, so getting here means we've won.
+ exit 0