X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/09fb8f032d2f544f254b30a89e1eb678ec95d971..7ac2aef2fd35ed0cffe2b558b69643f12662a03e:/links-depth.diff diff --git a/links-depth.diff b/links-depth.diff index 2e7a758..30cac5a 100644 --- a/links-depth.diff +++ b/links-depth.diff @@ -6,20 +6,20 @@ with the latest codebase, but even in its original form it didn't handle relative symlinks properly, and that has not yet been fixed in this modified version. ---- orig/flist.c 2005-02-14 02:45:10 -+++ flist.c 2004-07-16 16:58:04 -@@ -51,6 +51,7 @@ extern int filesfrom_fd; - extern int one_file_system; +--- old/flist.c ++++ new/flist.c +@@ -45,6 +45,7 @@ extern int one_file_system; + extern int copy_dirlinks; extern int keep_dirlinks; extern int preserve_links; +extern int follow_links_depth; extern int preserve_hard_links; - extern int preserve_perms; extern int preserve_devices; -@@ -737,6 +738,30 @@ static struct file_struct *receive_file_ + extern int preserve_specials; +@@ -715,6 +716,30 @@ static struct file_struct *receive_file_ + return file; } - +#if SUPPORT_LINKS +static int links_depth(char *linkname, STRUCT_STAT *st_ptr) +{ @@ -47,7 +47,7 @@ in this modified version. /** * Create a file_struct for a named file by reading its stat() * information and performing extensive checks against global -@@ -862,7 +887,13 @@ skip_filters: +@@ -849,7 +874,13 @@ struct file_struct *make_file(char *fnam basename_len = strlen(basename) + 1; /* count the '\0' */ #ifdef SUPPORT_LINKS @@ -62,36 +62,36 @@ in this modified version. #else linkname_len = 0; #endif ---- orig/options.c 2005-02-14 02:45:10 -+++ options.c 2005-01-28 19:33:24 -@@ -43,6 +43,7 @@ int archive_mode = 0; - int keep_dirlinks = 0; +--- old/options.c ++++ new/options.c +@@ -44,6 +44,7 @@ int keep_dirlinks = 0; + int copy_dirlinks = 0; int copy_links = 0; int preserve_links = 0; +int follow_links_depth = 0; int preserve_hard_links = 0; int preserve_perms = 0; - int preserve_devices = 0; -@@ -263,6 +264,7 @@ void usage(enum logcode F) - rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); + int preserve_executability = 0; +@@ -287,6 +288,7 @@ void usage(enum logcode F) + rprintf(F," --append append data onto shorter files\n"); rprintf(F," -d, --dirs transfer directories without recursing\n"); rprintf(F," -l, --links copy symlinks as symlinks\n"); + rprintf(F," --links-depth=NUM follow symlinks up to NUM depth\n"); rprintf(F," -L, --copy-links transform symlink into referent file/dir\n"); rprintf(F," --copy-unsafe-links only \"unsafe\" symlinks are transformed\n"); rprintf(F," --safe-links ignore symlinks that point outside the source tree\n"); -@@ -383,6 +385,7 @@ static struct poptOption long_options[] - {"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 }, - {"dirs", 'd', POPT_ARG_VAL, &xfer_dirs, 2, 0, 0 }, - {"links", 'l', POPT_ARG_NONE, &preserve_links, 0, 0, 0 }, +@@ -432,6 +434,7 @@ static struct poptOption long_options[] + {"links", 'l', POPT_ARG_VAL, &preserve_links, 1, 0, 0 }, + {"no-links", 0, POPT_ARG_VAL, &preserve_links, 0, 0, 0 }, + {"no-l", 0, POPT_ARG_VAL, &preserve_links, 0, 0, 0 }, + {"links-depth", 0, POPT_ARG_INT, &follow_links_depth , 0, 0, 0 }, {"copy-links", 'L', POPT_ARG_NONE, ©_links, 0, 0, 0 }, - {"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 }, - {"whole-file", 'W', POPT_ARG_VAL, &whole_file, 1, 0, 0 }, ---- orig/rsync.yo 2005-02-14 02:45:11 -+++ rsync.yo 2005-01-28 19:33:40 -@@ -311,6 +311,7 @@ to the detailed description below for a - --inplace update destination files in-place + {"copy-unsafe-links",0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 }, + {"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 }, +--- old/rsync.yo ++++ new/rsync.yo +@@ -313,6 +313,7 @@ to the detailed description below for a + --append append data onto shorter files -d, --dirs transfer directories without recursing -l, --links copy symlinks as symlinks + --links-depth=NUM follow symlinks up to NUM depth