X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/f891cd928e6af5984a2df9a29f88b3706f2312fe..3f8612ce2569c52e9bf7f614c4555eb311a462c5:/cvs-entries.diff diff --git a/cvs-entries.diff b/cvs-entries.diff index a279991..f0cb813 100644 --- a/cvs-entries.diff +++ b/cvs-entries.diff @@ -2,9 +2,18 @@ This patch causes the --cvs-exclude option to prefix the names listed in each dir's CVS/Entries file as per-dir includes before the dir's list of excludes taken from the .cvsignore file. ---- exclude.c 7 Apr 2005 18:06:06 -0000 1.115 -+++ exclude.c 7 Apr 2005 18:06:34 -0000 -@@ -442,6 +442,14 @@ void *push_local_filters(const char *dir +--- orig/exclude.c 2006-01-28 00:16:01 ++++ exclude.c 2005-12-17 21:18:38 +@@ -221,6 +221,8 @@ static void add_rule(struct filter_list_ + if (!(lp = new_array(struct filter_list_struct, 1))) + out_of_memory("add_rule"); + lp->head = lp->tail = NULL; ++ if (mflags & MATCHFLG_CVS_IGNORE) ++ cp = "CVS"; + if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0) + out_of_memory("add_rule"); + ret->u.mergelist = lp; +@@ -454,6 +456,14 @@ void *push_local_filters(const char *dir set_filter_dir(dir, dirlen); } @@ -19,59 +28,127 @@ of excludes taken from the .cvsignore file. if (strlcpy(dirbuf + dirbuf_len, ex->pattern, MAXPATHLEN - dirbuf_len) < MAXPATHLEN - dirbuf_len) { parse_filter_file(lp, dirbuf, ex->match_flags, -@@ -958,6 +966,7 @@ void parse_filter_file(struct filter_lis - char line[MAXPATHLEN+MAX_RULE_PREFIX+1]; /* +1 for trailing slash. */ +@@ -970,6 +980,7 @@ void parse_filter_file(struct filter_lis + char line[BIGPATHBUFLEN]; char *eob = line + sizeof line - 1; int word_split = mflags & MATCHFLG_WORD_SPLIT; + int slash_parse = xflags & XFLG_CVS_ENTRIES ? 1 : 0; if (!fname || !*fname) return; -@@ -1002,6 +1011,29 @@ void parse_filter_file(struct filter_lis - continue; +@@ -1016,6 +1027,24 @@ void parse_filter_file(struct filter_lis + } break; } -+ switch (slash_parse) { -+ case 1: -+ if (ch == '/') { -+ s = line; ++ switch (slash_parse) { /* CVS/Entries parsing: */ ++ case 1: /* Ignore starting chars until first slash. */ ++ if (ch == '/') + slash_parse = 2; -+ continue; -+ } -+ break; -+ case 2: ++ continue; ++ case 2: /* Name ends at 2nd slash on the line. */ + if (ch == '/') { + slash_parse = 3; + continue; + } + break; -+ case 3: ++ case 3: /* Ignore trailing chars until EOL. */ + if (ch == '\n' || ch == '\r') { + slash_parse = 1; -+ goto double_break; ++ goto end_the_line; + } + continue; -+ default: -+ break; + } if (word_split && isspace(ch)) break; if (eol_nulls? !ch : (ch == '\n' || ch == '\r')) -@@ -1011,6 +1043,7 @@ void parse_filter_file(struct filter_lis +@@ -1025,13 +1054,15 @@ void parse_filter_file(struct filter_lis else overflow = 1; } -+ double_break: ++ end_the_line: if (overflow) { rprintf(FERROR, "discarding over-long filter: %s...\n", line); s = line; ---- rsync.h 28 Mar 2005 17:08:47 -0000 1.261 -+++ rsync.h 7 Apr 2005 18:06:34 -0000 -@@ -115,6 +115,7 @@ - #define XFLG_FATAL_ERRORS (1<<0) + } + *s = '\0'; + /* Skip an empty token and (when line parsing) comments. */ +- if (*line && (word_split || (*line != ';' && *line != '#'))) ++ if (*line && (word_split || slash_parse ++ || (*line != ';' && *line != '#'))) + parse_rule(listp, line, mflags, xflags); + if (ch == EOF) + break; +--- orig/rsync.h 2006-01-30 20:39:09 ++++ rsync.h 2005-12-17 19:52:48 +@@ -116,6 +116,7 @@ #define XFLG_OLD_PREFIXES (1<<1) #define XFLG_ANCHORED2ABS (1<<2) -+#define XFLG_CVS_ENTRIES (1<<3) + #define XFLG_ABS_IF_SLASH (1<<3) ++#define XFLG_CVS_ENTRIES (1<<4) + + #define ATTRS_REPORT (1<<0) + #define ATTRS_SKIP_MTIME (1<<1) +--- orig/testsuite/exclude.test 2006-01-26 22:14:14 ++++ testsuite/exclude.test 2005-12-30 07:32:41 +@@ -21,6 +21,7 @@ set -x + + makepath "$fromdir/foo/down/to/you" + makepath "$fromdir/foo/sub" ++makepath "$fromdir/bar/down/to/CVS" + makepath "$fromdir/bar/down/to/foo/too" + makepath "$fromdir/bar/down/to/bar/baz" + makepath "$fromdir/mid/for/foo/and/that/is/who" +@@ -59,6 +60,9 @@ echo cvsout >"$fromdir/bar/down/to/foo/f + echo gone >"$fromdir/bar/down/to/foo/file3" + echo lost >"$fromdir/bar/down/to/foo/file4" + echo weird >"$fromdir/bar/down/to/foo/+ file3" ++echo cvsin >"$fromdir/bar/down/to/not.junk" ++echo cvsout >"$fromdir/bar/down/to/not.good" ++echo cvsout >"$fromdir/bar/down/to/D" + echo cvsout-but-filtin >"$fromdir/bar/down/to/foo/file4.junk" + echo smashed >"$fromdir/bar/down/to/foo/to" + cat >"$fromdir/bar/down/to/bar/.filt2" <"$excl" <"$scratchdir/.cvsignore" <"$fromdir/bar/down/to/CVS/Entries" <"$fromdir/bar/down/to/.cvsignore" <