From 2acf81eb004292893a86b9e2cfa7f2ab4fcc2fb6 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Tue, 3 Nov 1998 21:17:40 +0000 Subject: [PATCH] Add support for optional ":PORT" in rsync URL. --- main.c | 6 ++++++ options.c | 5 +++-- rsync.yo | 11 ++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index bc587ccc..9b377386 100644 --- a/main.c +++ b/main.c @@ -464,6 +464,7 @@ static int start_client(int argc, char *argv[]) extern int local_server; extern int am_sender; extern char *shell_cmd; + extern int rsync_port; if (strncasecmp(URL_PREFIX, argv[0], strlen(URL_PREFIX)) == 0) { char *host, *path; @@ -476,6 +477,11 @@ static int start_client(int argc, char *argv[]) } else { path=""; } + p = strchr(host,':'); + if (p) { + rsync_port = atoi(p+1); + *p = 0; + } return start_socket_client(host, path, argc-1, argv+1); } diff --git a/options.c b/options.c index 9d7ad92c..2a46a5b7 100644 --- a/options.c +++ b/options.c @@ -88,6 +88,7 @@ void usage(int F) rprintf(F," or rsync [OPTION]... SRC DEST\n"); rprintf(F," or rsync [OPTION]... [USER@]HOST::SRC DEST\n"); rprintf(F," or rsync [OPTION]... SRC [USER@]HOST::DEST\n"); + rprintf(F," or rsync [OPTION]... rsync://HOST[:PORT]/SRC DEST\n"); rprintf(F,"\nOptions\n"); rprintf(F," -v, --verbose increase verbosity\n"); rprintf(F," -c, --checksum always checksum\n"); @@ -122,9 +123,9 @@ void usage(int F) rprintf(F," -T --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," -z, --compress compress file data\n"); - rprintf(F," --exclude=PATTERN exclude file FILE\n"); + rprintf(F," --exclude=PATTERN exclude files matching PATTERN\n"); rprintf(F," --exclude-from=FILE exclude patterns listed in FILE\n"); - rprintf(F," --include=PATTERN don't exclude file FILE\n"); + rprintf(F," --include=PATTERN don't exclude files matching PATTERN\n"); rprintf(F," --include-from=FILE don't exclude patterns listed in FILE\n"); rprintf(F," --suffix=SUFFIX override backup suffix\n"); rprintf(F," --version print version number\n"); diff --git a/rsync.yo b/rsync.yo index 15f62859..7e2e4738 100644 --- a/rsync.yo +++ b/rsync.yo @@ -13,7 +13,7 @@ rsync [options] [user@]host::module[/path] path rsync [options] path [user@]host::module[/path] -rsync [options] rsync://host/module/path path +rsync [options] rsync://host[:port]/module/path path manpagedescription() @@ -208,6 +208,7 @@ Usage: rsync [OPTION]... SRC [USER@]HOST:DEST or rsync [OPTION]... SRC DEST or rsync [OPTION]... [USER@]HOST::SRC DEST or rsync [OPTION]... SRC [USER@]HOST::DEST + or rsync [OPTION]... rsync://HOST[:PORT]/SRC DEST Options -v, --verbose increase verbosity @@ -243,10 +244,10 @@ Options -T --temp-dir=DIR create temporary files in directory DIR --compare-dest=DIR also compare destination files relative to DIR -z, --compress compress file data - --exclude=PATTERN exclude file FILE - --exclude-from=PATTERN exclude files listed in FILE - --include=PATTERN don't exclude file FILE - --include-from=PATTERN don't exclude files listed in FILE + --exclude=PATTERN exclude files matching PATTERN + --exclude-from=FILE exclude files listed in FILE + --include=PATTERN don't exclude files matching PATTERN + --include-from=FILE don't exclude files listed in FILE --suffix=SUFFIX override backup suffix --version print version number --daemon run as a rsync daemon -- 2.34.1