diff options
| author | Wayne Davison <wayned@samba.org> | 2006-01-28 00:14:02 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2006-01-28 00:14:02 +0000 |
| commit | d5782b52a2141a14d54cd74efa406d4428b0c5ae (patch) | |
| tree | 6a693e3f154df3f5e7c24579a56fa974a0b0ff6c /exclude.c | |
| parent | 85aecef6c346c6cd76e0108be257a85783cde17d (diff) | |
| download | android_external_rsync-d5782b52a2141a14d54cd74efa406d4428b0c5ae.tar.gz android_external_rsync-d5782b52a2141a14d54cd74efa406d4428b0c5ae.tar.bz2 android_external_rsync-d5782b52a2141a14d54cd74efa406d4428b0c5ae.zip | |
- We need to send exclude info from the client to a server-receiver
when --prune-empty-dirs was specified.
- Changed the output of debug include/exclude/show/hide/risk/protect
messages to use the appropriate filter terminology instead of
always using the (potentially unclear) include/exclude terms.
Diffstat (limited to 'exclude.c')
| -rw-r--r-- | exclude.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -36,6 +36,7 @@ extern int io_error; extern int local_server; extern int saw_delete_opt; extern int saw_delete_excluded_opt; +extern int prune_empty_dirs; extern int delete_mode; extern int delete_excluded; extern int cvs_exclude; @@ -586,11 +587,13 @@ static void report_filter_result(char const *name, * case we add it back in here. */ if (verbose >= 2) { - rprintf(FINFO, "[%s] %scluding %s %s because of pattern %s%s%s\n", - who_am_i(), - ent->match_flags & MATCHFLG_INCLUDE ? "in" : "ex", - name_is_dir ? "directory" : "file", name, ent->pattern, - ent->match_flags & MATCHFLG_DIRECTORY ? "/" : "", type); + static char *actions[2][2] + = { {"show", "hid"}, {"risk", "protect"} }; + const char *w = who_am_i(); + rprintf(FINFO, "[%s] %sing %s %s because of pattern %s%s%s\n", + w, actions[*w!='s'][!(ent->match_flags&MATCHFLG_INCLUDE)], + name_is_dir ? "directory" : "file", name, ent->pattern, + ent->match_flags & MATCHFLG_DIRECTORY ? "/" : "", type); } } @@ -1147,8 +1150,8 @@ static void send_rules(int f_out, struct filter_list_struct *flp) /* This is only called by the client. */ void send_filter_list(int f_out) { - int receiver_wants_list = delete_mode - && (!delete_excluded || protocol_version >= 29); + int receiver_wants_list = prune_empty_dirs + || (delete_mode && (!delete_excluded || protocol_version >= 29)); if (local_server || (am_sender && !receiver_wants_list)) f_out = -1; @@ -1181,8 +1184,9 @@ void recv_filter_list(int f_in) { char line[BIGPATHBUFLEN]; int xflags = protocol_version >= 29 ? 0 : XFLG_OLD_PREFIXES; - int receiver_wants_list = saw_delete_opt - && (!saw_delete_excluded_opt || protocol_version >= 29); + int receiver_wants_list = prune_empty_dirs + || (saw_delete_opt + && (!saw_delete_excluded_opt || protocol_version >= 29)); unsigned int len; if (!local_server && (am_sender || receiver_wants_list)) { |
