---- exclude.c 22 Apr 2004 09:58:15 -0000 1.70
+--- exclude.c 22 Apr 2004 22:17:15 -0000 1.71
+++ exclude.c 22 Apr 2004 10:32:52 -0000
@@ -27,15 +27,17 @@
#include "rsync.h"
}
static int check_one_exclude(char *name, struct exclude_struct *ex,
-@@ -215,21 +233,25 @@ static void report_exclude_result(char c
+@@ -215,22 +233,25 @@ static void report_exclude_result(char c
/*
* Return true if file NAME is defined to be excluded by the specified
-- * exclude list.
-+ * exclude list. Returns -1 for exclude, 0 for normal include, or 1
-+ * for super include.
+- * exclude list. Returns -1 for an exclude, 1 for an include, and 0 if
+- * no match.
++ * exclude list. Returns -1 for an exclude, 0 for a normal include, or 1
++ * for a super include.
*/
-int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir)
+int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir,
if (check_one_exclude(name, ent, name_is_dir)) {
report_exclude_result(name, ent, name_is_dir,
listp->debug_type);
-- return !ent->include;
+- return ent->include ? 1 : -1;
+ return ent->include - 1;
}
}
}
-@@ -255,10 +277,10 @@ static const char *get_exclude_tok(const
+@@ -256,10 +277,10 @@ static const char *get_exclude_tok(const
p = (const char *)s;
}
s += 2;
} else
*incl_ptr = xflags & XFLG_DEF_INCLUDE;
-@@ -390,8 +412,12 @@ void send_exclude_list(int f)
+@@ -391,8 +412,12 @@ void send_exclude_list(int f)
if (ent->include) {
write_int(f, l + 2);
write_int(f, l + 2);
write_buf(f, "- ", 2);
} else
---- flist.c 22 Apr 2004 09:58:18 -0000 1.215
+--- flist.c 22 Apr 2004 22:17:15 -0000 1.216
+++ flist.c 22 Apr 2004 10:32:52 -0000
@@ -40,6 +40,7 @@ extern int ignore_errors;
extern int numeric_ids;
extern struct exclude_list_struct local_exclude_list;
int io_error;
-@@ -211,6 +213,10 @@ int link_stat(const char *path, STRUCT_S
+@@ -211,7 +213,9 @@ int link_stat(const char *path, STRUCT_S
*/
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
{
+- int rc;
+ static struct exclude_list_struct *elist[] = {
+ &exclude_list, &perdir_exclude_list, &local_exclude_list, NULL };
+ int i, rc;
-+
+
#if 0 /* This currently never happens, so avoid a useless compare. */
if (exclude_level == NO_EXCLUDES)
- return 0;
-@@ -227,16 +233,18 @@ static int check_exclude_file(char *fnam
+@@ -229,17 +233,18 @@ static int check_exclude_file(char *fnam
}
}
if (server_exclude_list.head
-- && check_exclude(&server_exclude_list, fname, is_dir))
-+ && check_exclude(&server_exclude_list, fname, is_dir, 0) < 0)
+- && check_exclude(&server_exclude_list, fname, is_dir) < 0)
++ && check_exclude(&server_exclude_list, fname, is_dir, 0) < 0)
return 1;
if (exclude_level != ALL_EXCLUDES)
return 0;
-- if (exclude_list.head && check_exclude(&exclude_list, fname, is_dir))
-- return 1;
+- if (exclude_list.head
+- && (rc = check_exclude(&exclude_list, fname, is_dir)) != 0)
+- return rc < 0;
- if (local_exclude_list.head
-- && check_exclude(&local_exclude_list, fname, is_dir))
+- && check_exclude(&local_exclude_list, fname, is_dir) < 0)
- return 1;
- return 0;
+ for (i = 0, rc = 0; elist[i]; i++) {
}
/* used by the one_file_system code */
-@@ -944,8 +952,12 @@ void send_file_name(int f, struct file_l
+@@ -947,8 +952,12 @@ void send_file_name(int f, struct file_l
if (recursive && S_ISDIR(file->mode)
&& !(file->flags & FLAG_MOUNT_POINT)) {
struct exclude_list_struct last_list = local_exclude_list;
free_exclude_list(&local_exclude_list);
local_exclude_list = last_list;
}
-@@ -991,6 +1003,18 @@ static void send_directory(int f, struct
+@@ -994,6 +1003,18 @@ static void send_directory(int f, struct
io_error |= IOERR_GENERAL;
rprintf(FINFO,
"cannot cvs-exclude in long-named directory %s\n",
char *debug_type;
};
---- rsync.yo 17 Apr 2004 18:40:16 -0000 1.159
+--- rsync.yo 22 Apr 2004 21:35:45 -0000 1.161
+++ rsync.yo 22 Apr 2004 10:32:54 -0000
@@ -331,6 +331,7 @@ verb(
--exclude-from=FILE exclude patterns listed in FILE
--files-from=FILE read FILE for list of source-file names
-0 --from0 all file lists are delimited by nulls
--version print version number
-@@ -672,6 +673,15 @@ dit(bf(--include-from=FILE)) This specif
+@@ -675,6 +676,15 @@ dit(bf(--include-from=FILE)) This specif
from a file.
If em(FILE) is bf(-) the list will be read from standard input.
dit(bf(--files-from=FILE)) Using this option allows you to specify the
exact list of files to transfer (as read from the specified FILE or "-"
for stdin). It also tweaks the default behavior of rsync to make
-@@ -711,7 +721,8 @@ was located on the remote "src" host.
+@@ -714,7 +724,8 @@ was located on the remote "src" host.
dit(bf(-0, --from0)) This tells rsync that the filenames it reads from a
file are terminated by a null ('\0') character, not a NL, CR, or CR+LF.
It does not affect --cvs-exclude (since all names read from a .cvsignore
file are split on whitespace).
-@@ -998,6 +1009,12 @@ itemize(
+@@ -1001,6 +1012,12 @@ itemize(
it() if the pattern starts with "- " (a minus followed by a space)
then it is always considered an exclude pattern, even if specified as
part of an include option. The prefix is discarded before matching.
{
/* This function doesn't really get called in this test context, so
* just return 0. */
---- util.c 22 Apr 2004 09:58:21 -0000 1.137
+--- util.c 22 Apr 2004 22:17:15 -0000 1.138
+++ util.c 22 Apr 2004 10:32:54 -0000
@@ -476,7 +476,7 @@ static int exclude_server_path(char *arg
if (server_exclude_list.head) {
for (s = arg; (s = strchr(s, '/')) != NULL; ) {
*s = '\0';
-- if (check_exclude(&server_exclude_list, arg, 1)) {
+- if (check_exclude(&server_exclude_list, arg, 1) < 0) {
+ if (check_exclude(&server_exclude_list, arg, 1, 0) < 0) {
/* We must leave arg truncated! */
return 1;