Patch from J.W. Schultz to have --include-from and --exclude-from on

filename "-" read from standard input.
This commit is contained in:
David Dykstra
2002-08-29 14:37:20 +00:00
parent 3b5f6214a6
commit f8a94f0de8
3 changed files with 14 additions and 1 deletions

3
NEWS
View File

@@ -15,6 +15,9 @@ rsync changes since last release
* The rsync:// syntax for daemon connections is now accepted in the
destination field.
* If the file name given to --include-from or --exclude-from is "-",
rsync will read from standard input. (J.W. Schultz)
BUG FIXES:
* Fix "forward name lookup failed" errors on AIX 4.3.3. (John

View File

@@ -220,8 +220,14 @@ struct exclude_struct **make_exclude_list(const char *fname,
int fatal, int include)
{
struct exclude_struct **list=list1;
FILE *f = fopen(fname,"r");
FILE *f;
char line[MAXPATHLEN];
if (strcmp(fname, "-")) {
f = fopen(fname,"r");
} else {
f = fdopen(0, "r");
}
if (!f) {
if (fatal) {
rsyserr(FERROR, errno,

View File

@@ -617,6 +617,8 @@ dit(bf(--exclude-from=FILE)) This option is similar to the --exclude
option, but instead it adds all exclude patterns listed in the file
FILE to the exclude list. Blank lines in FILE and lines starting with
';' or '#' are ignored.
If em(FILE) is bf(-) the list will be read from standard input.
dit(bf(--include=PATTERN)) This option tells rsync to not exclude the
specified pattern of filenames. This is useful as it allows you to
@@ -627,6 +629,8 @@ this option.
dit(bf(--include-from=FILE)) This specifies a list of include patterns
from a file.
If em(FILE) is bf(-) the list will be read from standard input.
dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a
broad range of files that you often don't want to transfer between