if (am_server) {
if (!checksum_seed)
checksum_seed = time(NULL);
---- orig/exclude.c 2005-02-05 06:48:21
-+++ exclude.c 2005-02-05 06:56:47
+--- orig/exclude.c 2005-02-08 19:06:38
++++ exclude.c 2005-02-08 18:34:22
@@ -53,7 +53,8 @@ struct filter_list_struct server_filter_
#define MAX_RULE_PREFIX (16)
/* The dirbuf is set by push_local_filters() to the current subdirectory
* relative to curr_dir that is being processed. The path always has a
-@@ -667,6 +668,14 @@ static const char *parse_rule_tok(const
+@@ -678,6 +679,10 @@ static const char *parse_rule_tok(const
+ if ((s = RULE_MATCH(s, "exclude")) != NULL)
+ ch = '-';
+ break;
++ case 'h':
++ if ((s = RULE_MATCH(s, "hide")) != NULL)
++ ch = 'H';
++ break;
+ case 'i':
+ if ((s = RULE_MATCH(s, "include")) != NULL)
+ ch = '+';
+@@ -686,6 +691,19 @@ static const char *parse_rule_tok(const
+ if ((s = RULE_MATCH(s, "merge")) != NULL)
+ ch = '.';
+ break;
++ case 'p':
++ if ((s = RULE_MATCH(s, "protect")) != NULL)
++ ch = 'P';
++ break;
++ case 's':
++ if ((s = RULE_MATCH(s, "send")) != NULL)
++ ch = 'S';
++ break;
++ case 'u':
++ if ((s = RULE_MATCH(s, "unprotect")) != NULL)
++ ch = 'U';
++ break;
++
+ default:
+ ch = *s;
+ if (s[1] == ',')
+@@ -707,6 +725,20 @@ static const char *parse_rule_tok(const
case '-':
mods = MODIFIERS_INCL_EXCL;
break;
++ case 'S':
++ new_mflags |= MATCHFLG_INCLUDE;
++ /* FALL THROUGH */
+ case 'H':
+ new_mflags |= MATCHFLG_SENDER_SIDE;
+ mods = MODIFIERS_HIDE_PROTECT;
+ break;
++ case 'U':
++ new_mflags |= MATCHFLG_INCLUDE;
++ /* FALL THROUGH */
+ case 'P':
+ new_mflags |= MATCHFLG_RECEIVER_SIDE;
+ mods = MODIFIERS_HIDE_PROTECT;
case '!':
new_mflags |= MATCHFLG_CLEAR_LIST;
mods = NULL;
-@@ -719,6 +728,12 @@ static const char *parse_rule_tok(const
+@@ -759,6 +791,12 @@ static const char *parse_rule_tok(const
case 'n':
new_mflags |= MATCHFLG_NO_INHERIT;
break;
case 'w':
new_mflags |= MATCHFLG_WORD_SPLIT;
break;
-@@ -973,6 +988,11 @@ char *get_rule_prefix(int match_flags, c
+@@ -1013,6 +1051,11 @@ char *get_rule_prefix(int match_flags, c
}
if (match_flags & MATCHFLG_EXCLUDE_SELF)
*op++ = 'e';
if (legal_len)
*op++ = ' ';
if (op - buf > legal_len)
-@@ -985,19 +1005,37 @@ char *get_rule_prefix(int match_flags, c
+@@ -1025,19 +1068,37 @@ char *get_rule_prefix(int match_flags, c
static void send_rules(int f_out, struct filter_list_struct *flp)
{
p = get_rule_prefix(ent->match_flags, ent->pattern, 1, &plen);
if (!p) {
rprintf(FERROR,
-@@ -1015,12 +1053,13 @@ static void send_rules(int f_out, struct
+@@ -1055,12 +1116,13 @@ static void send_rules(int f_out, struct
if (dlen)
write_byte(f_out, '/');
}
if (local_server || (am_sender && !receiver_wants_list))
f_out = -1;
-@@ -1035,10 +1074,10 @@ void send_filter_list(int f_out)
+@@ -1075,10 +1137,10 @@ void send_filter_list(int f_out)
if (list_only == 1 && !recurse)
parse_rule(&filter_list, "/*/*", MATCHFLG_NO_PREFIXES, 0);
if (cvs_exclude) {
if (!am_sender || protocol_version < 29)
-@@ -1054,7 +1093,7 @@ void recv_filter_list(int f_in)
+@@ -1094,7 +1156,7 @@ void recv_filter_list(int f_in)
char line[MAXPATHLEN+MAX_RULE_PREFIX+1]; /* +1 for trailing slash. */
int xflags = protocol_version >= 29 ? 0 : XFLG_OLD_PREFIXES;
unsigned int len;
if (!local_server && (am_sender || receiver_wants_list)) {
while ((len = read_int(f_in)) != 0) {
-@@ -1071,4 +1110,7 @@ void recv_filter_list(int f_in)
+@@ -1111,4 +1173,7 @@ void recv_filter_list(int f_in)
if (local_server || am_sender)
parse_rule(&filter_list, "-C", 0, 0);
}
+ if (local_server) /* filter out any rules that aren't for us. */
+ send_rules(-1, &filter_list);
}
---- orig/flist.c 2005-02-03 19:23:55
+--- orig/flist.c 2005-02-07 20:41:56
+++ flist.c 2005-02-05 05:31:09
-@@ -979,7 +979,7 @@ void send_file_name(int f, struct file_l
+@@ -980,7 +980,7 @@ void send_file_name(int f, struct file_l
/* f is set to -1 when calculating deletion file list */
file = make_file(fname, flist,
if (!file)
return;
---- orig/rsync.h 2005-02-04 22:28:09
+--- orig/rsync.h 2005-02-07 20:41:57
+++ rsync.h 2005-02-05 05:31:10
@@ -565,9 +565,12 @@ struct map_struct {
#define MATCHFLG_FINISH_SETUP (1<<13)/* per-dir merge file needs setup */
struct filter_struct {
struct filter_struct *next;
---- orig/rsync.yo 2005-02-06 07:24:23
-+++ rsync.yo 2005-02-06 07:21:31
+--- orig/rsync.yo 2005-02-08 19:06:38
++++ rsync.yo 2005-02-08 19:10:12
@@ -678,7 +678,9 @@ send the whole directory (e.g. "dir" or
for the directory's contents (e.g. "dir/*") since the wildcard is expanded
by the shell and rsync thus gets a request to transfer individual files, not
See bf(--delete) (which is implied) for more details on file-deletion.
dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
-@@ -1241,6 +1246,8 @@ bf(-) specifies an exclude pattern. nl()
- bf(+) specifies an include pattern. nl()
- bf(.) specifies a merge-file to read for more rules. nl()
- bf(:) specifies a per-directory merge-file. nl()
-+bf(H) specifies a pattern for hiding files from the transfer. nl()
-+bf(P) specifies a pattern for protecting files from deletion. nl()
- bf(!) clears the current include/exclude list (takes no arg) nl()
+@@ -1243,6 +1248,10 @@ bf(exclude, -) specifies an exclude patt
+ bf(include, +) specifies an include pattern. nl()
+ bf(merge, .) specifies a merge-file to read for more rules. nl()
+ bf(dir-merge, :) specifies a per-directory merge-file. nl()
++bf(hide, H) specifies a pattern for hiding files from the transfer. nl()
++bf(send, S) the opposite of a "hide". nl()
++bf(protect, P) specifies a pattern for protecting files from deletion. nl()
++bf(unprotect, U) the opposite of a "protect". nl()
+ bf(clear, !) clears the current include/exclude list (takes no arg) nl()
)
-@@ -1263,8 +1270,13 @@ comment lines that start with a "#".
+@@ -1267,8 +1276,8 @@ the bf(--include-from)/bf(--exclude-from
manpagesection(INCLUDE/EXCLUDE PATTERN RULES)
-You can include and exclude files by specifying patterns using the "+" and
-"-" filter rules (as introduced in the FILTER RULES section above).
+You can include and exclude files by specifying patterns using the "+",
-+"-", "H", and "P" filter rules (as introduced in the FILTER RULES section
-+above).
-+Note that the "H" (hide) rule is just a more intuitive way to specify a "-"
-+rule with an "s" modifier (a sender-only exclusion) and "P" (protect) is
-+just a more intuitive way to specify a "-" rule with an "r" modifier (a
-+receiver-only exclusion). See the modifiers below for more information.
-
++"-", etc. filter rules (as introduced in the FILTER RULES section above).
The include/exclude rules each specify a pattern that is matched against
the names of the files that are going to be transferred. These patterns
-@@ -1402,7 +1414,9 @@ itemize(
- specified to turn off the parsing of prefixes).
- it() You may also specify any of the modifiers for "+" or "-" to have the
- rules that are read-in default to having that option set. For instance,
-- ".-/_.excl" would treat the contents of .excl as absolute-path excludes.
-+ ".-/_.excl" would treat the contents of .excl as absolute-path excludes,
-+ while ":s_.filt" and ":Cs" would each make all their per-directory
-+ rules apply only on the server side.
+ can take several forms:
+@@ -1407,7 +1416,9 @@ itemize(
+ it() You may also specify any of the modifiers for the "+" or "-" rules
+ (below) in order to have the rules that are read-in from the file
+ default to having that modifier set. For instance, "merge,-/_.excl" would
+- treat the contents of .excl as absolute-path excludes.
++ treat the contents of .excl as absolute-path excludes,
++ while "dir-merge,s_.filt" and ":sC" would each make all their
++ per-directory rules apply only on the server side.
)
The following modifiers are accepted after a "+" or "-":
-@@ -1418,6 +1432,16 @@ itemize(
+@@ -1423,6 +1434,16 @@ itemize(
it() A bf(C) is used to indicate that all the global CVS-exclude rules
should be inserted as excludes in place of the "-C". No arg should
follow.