Commit Graph

115 Commits

Author SHA1 Message Date
Wayne Davison
664cf3278a Make sure that "- !" or "+ !" aren't interpreted as a list-clearing
token.
2005-04-07 18:06:06 +00:00
Wayne Davison
ac1cb9380d Tweaked an error message. 2005-02-27 07:34:27 +00:00
Wayne Davison
2217b30adf Fixed a problem sending include rules to an older rsync. 2005-02-26 02:56:30 +00:00
Wayne Davison
4adbb5f246 Have rule_strcmp() accept and return a uchar*. 2005-02-20 17:04:53 +00:00
Wayne Davison
6d7b3d52dc Rules read in from per-dir merge files need to have non-applicable
rules filtered out before the rule gets stored (not in a post-
filtering pass like the rules that are read-in prior to the run).
2005-02-19 03:12:21 +00:00
Wayne Davison
ed243f8c29 - Added modifiers for the include/exclude rules that makes them
apply to the indicated (sender/receiver) side.
- Added the hide/show and protect/risk filter rules as an alternate
  way to specify sender-/receiver-specific include/exclude rules.
- send_rules() now allows f_out to be -1 to indicate that the list
  should be scanned but not sent.
- send_rules() now filters the list to remove any items that don't
  apply to the current side (after sending the item to the other
  side when f_out != -1).
- {send,recv}_filter_list() now transfer the list, even when the
  receiver is the server and --delete-excluded was specified (the
  exchanged list is appropriately filtered, of course).
- recv_filter_list() uses send_rules() to trim non-applicable rules
  when we're a local-server (because we got our filter list without
  send/recv calls when fork() duplicated it).
2005-02-12 19:52:26 +00:00
Wayne Davison
345e0988cb Changed rule_match() to rule_strcmp(). Likewise for the
define RULE_MATCH() being changed into RULE_STRCMP().
2005-02-11 10:47:43 +00:00
Wayne Davison
64b761c19a Allow a ',' to prefix the MODIFIERS for a single-letter filter rule. 2005-02-08 18:47:25 +00:00
Wayne Davison
a1ac8edd66 - Added long-name filter rules.
- Only parse the "!" token when MATCHFLG_NO_PREFIXES is set if
  MATCHFLG_CVS_IGNORE is also set.
2005-02-08 18:33:16 +00:00
Wayne Davison
a6126d678b Added missing call to safe_fname(). 2005-02-07 20:38:56 +00:00
Wayne Davison
448797a1e6 Fixed an off-by-one error in the prefix-length checking in
get_rule_prefix().
2005-02-05 06:53:20 +00:00
Wayne Davison
a261103ce0 Improved the name of a variable. 2005-02-05 05:30:06 +00:00
Wayne Davison
46db185081 - Moved get_cvs_excludes() up above its only use and made it static.
- Changed get_cvs_excludes() to make an mflags arg.
2005-02-04 22:32:17 +00:00
Wayne Davison
1412da7c32 If we're a "local server" (i.e. we just forked a server for a
local transfer), don't duplicate all the filter rules that we
already know about in the forked process.
2005-02-04 21:54:02 +00:00
Wayne Davison
d09e800a0e Fixed the way get_rule_prefix() turns the MATCHFLG_WORD_SPLIT flag
back into a modifier character.
2005-02-04 21:16:39 +00:00
Wayne Davison
fdc795015f - Changed filter_rule() to add_rule().
- Improved the debug info coming from add_rule().
- Changed add_filter() to parse_rule() and add_filter_file()
  to parse_filter_file().
- Changed get_filter_tok() to parse_rule_tok().
- Made the mflags a uint32.
- Added an extra arg to get_rule_prefix() to indicate if we're
  building the options for transmission or other purposes.
- The 'C' modifier can now be applied to a '-' rule, so it now
  sets a new flag: MATCHFLG_CVS_IGNORE.
- The send_filter_list() and recv_filter_list() functions now handle
  all the logic needed to do the right thing for -C (this used to be
  in main.c).
2005-02-04 21:13:06 +00:00
Wayne Davison
d727f0ff48 Fixed the MODIFIERS_MERGE_FILE define. 2005-02-04 00:48:18 +00:00
Wayne Davison
b6f06b8e8b Added an mflags arg to get_filter_tok(), add_filter_file(), and
add_filter().  This made for less flag conversion between various
MATCHFLG_* and XFLG_* values.  It also made it easy to fix a bug
in the handling of no-prefix per-directory include/exclude files.
We also use the new XFLG_OLD_PREFIXES and MATCHFLGS_FROM_CONTAINER
defines.
2005-02-03 19:00:20 +00:00
Wayne Davison
f2ae9e8583 Implemented a "!" modifier for filter rules that lets a rule trigger
on a non-matching pattern.
2005-02-03 03:36:58 +00:00
Wayne Davison
0b2901b72d Changed the "s" modifier to "w" for a word-splitting merge file. 2005-01-31 23:51:54 +00:00
Wayne Davison
bf39270e0c - Renamed make_filter() to filter_rule().
- Added the "/" modifier to the -/+ filter rules to allow the
  rule to specify an absolute path (sets MATCHFLG_ABS_PATH).
- Added the passing of the xflgags to filter_rule() and key off
  XFLG_ANCHORED2ABS to prepend the current dirbuf value (was
  keing off MATCHFLG_ABS_PATH).
- We no longer allow a '=' to separate the filter rule from its
  arg (just a single space or an underscore).
- For triple verbose levels, mention when we look for a filter
  file even if we don't find it (used to only mention the file
  when it was found).
- A chrooted daemon process now includes /.cvsignore (inside the
  chrooted hierarchy) instead of $HOME/.cvsignore.
2005-01-29 20:48:17 +00:00
Wayne Davison
5a016db9b6 Don't allow the user to specify a filter file that is excluded
by a daemon's config options.
2005-01-28 21:28:08 +00:00
Wayne Davison
0eeb1cf83a Case uchar pointer to a char pointer when calling strlen(). 2005-01-28 21:02:15 +00:00
Wayne Davison
417b59997f - Moved the code that turns rule flags into chars into a new
function called get_rule_prefix().
- Don't pass the per-dir .cvsignore rule from -C for protocols < 29.
2005-01-25 12:10:31 +00:00
Wayne Davison
7842418b7b Renamed several exclude-related functions/variables using new
filter terminology.
2005-01-25 10:39:14 +00:00
Wayne Davison
a2b371cd52 Don't try to allocate zero bytes in push_local_excludes(). 2005-01-25 02:30:59 +00:00
Wayne Davison
6dfd07d025 Implemented the core of the merge-file and per-dir merge-file support
for the --filter option.  Some noteworthy changes:
- Added push_local_excludes() and pop_local_excludes() to implement
  the changes needed as we go from directory to directory (this takes
  the place of the old local_exclude_list var that only handled the
  .cvsignore files).  These per-dir excludes are linked into the same
  exclude list as the global excludes.
- The exclude list is transferred as filter rules to an rsync that
  talks protocol 29 or above.  It limits itself to just include/exclude
  rules for older rsyncs.
2005-01-25 00:52:47 +00:00
Wayne Davison
353f272434 Changed a comment. 2005-01-22 20:27:22 +00:00
Wayne Davison
14d496cc8b Aid forward-compatibility in the include/exclude syntax by putting
a "- " in front of any name that starts with a '+' or a '-' and would
otherwise be unprefixed (the old code only did this if the '+' or '-'
was followed by a space).
2005-01-13 22:01:56 +00:00
Wayne Davison
e425fbe85d Re-enable the "!" token-handling in a .cvsignore file. 2004-10-06 00:10:08 +00:00
Wayne Davison
9a5e37fca8 In get_exclude_tok(), if XFLG_DIRECTORY was passed in the xflags,
set MATCHFLG_DIRECTORY in the mflags we return.
2004-09-22 04:11:15 +00:00
Wayne Davison
9f18657889 A minor improvement in check_one_exclude(). 2004-08-10 18:15:33 +00:00
Wayne Davison
7cd72c79ec Set "eob" correctly in add_exclude_file(). 2004-08-05 22:58:17 +00:00
Wayne Davison
65e2487096 Fixed the comment for get_exclude_tok(). 2004-05-22 05:32:20 +00:00
Wayne Davison
cb213f1c1b Got rid of a compiler warning (which was only output by certain
compilers).
2004-05-21 09:59:49 +00:00
Wayne Davison
8cbf495a57 Renamed free_exclude_list() to clear_exclude_list(). 2004-05-16 23:54:12 +00:00
Wayne Davison
c1b29492c5 Moved the setting of ret->match_flags up a little in make_exclude(). 2004-05-16 14:08:34 +00:00
Wayne Davison
5e972dcf34 - Switched the "include" and "directory" ints into bits in match_flags.
- Made some length vars unsigned.
2004-05-16 07:28:21 +00:00
Wayne Davison
619d21ffc9 - Complain about an exclude that was too long and then dump it
(used to be silently truncated).
- Include extra space in our exclude-reading buffers so that we
  can fit a 2-char prefix and a trailing slash and still handle
  a MAXPATHLEN name.
2004-05-15 19:31:13 +00:00
Wayne Davison
de91e75724 In the debug output, distinguish between a user-requested clearing
of the exclude list and the popping of the local exclude list that
occurs when we finish each subdir.
2004-05-14 21:23:41 +00:00
Wayne Davison
7f0feb4dd6 - Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY.
- Don't parse comment lines in add_exclude_file() when XFLG_WORD_SPLIT
  is set.
2004-04-27 01:36:06 +00:00
Wayne Davison
968ff560d2 Made a comment clearer. 2004-04-27 01:00:58 +00:00
Wayne Davison
82a51ea53d Improved the debug string for the local_exclude_list. 2004-04-24 08:00:39 +00:00
Wayne Davison
a6536635e3 Fixed a comment. 2004-04-23 08:09:13 +00:00
Wayne Davison
9fdb334e85 Restore the old include behavior where a command-line include could
override a .cvsignore exclude.
2004-04-22 22:17:15 +00:00
Wayne Davison
67340e9523 Initialize the new debug_type string in each exclude list and output
it in a couple extra debug messages.  When we free an exclude list,
make sure we don't clear the debug_type string.
2004-04-22 09:58:15 +00:00
Wayne Davison
24e1569f8b The debug output for add_exclude() now needs to limit the pattern to
print only "pat_len" chars.
2004-04-22 08:41:03 +00:00
Wayne Davison
40d38dc0be In add_exclude_file(), if we're word-splitting, stop reading a "line"
at any whitespace (so that we don't overflow the line buffer).
2004-04-17 17:55:45 +00:00
Wayne Davison
b2aa573b1c Our exclude lists are now comprised of a base structure with a head
and a tail pointer pointing to a linked list of items (rather than
an array of pointers that has to be reallocated all the time).
2004-04-14 23:33:40 +00:00
Wayne Davison
61414c83ce The check_exclude() and report_exclude_result() functions now take a
description string that describes what kind of an include/exclude is
happening (which only gets output when verbose is set to 2 or more).
2004-04-14 21:59:41 +00:00