X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/c769ea2c13526d5c5a0b10f377ec23b4ad7d6f3c..c2f699cc6bfb241c97cc53dfe6bfd0ea0385456c:/link-by-hash.diff diff --git a/link-by-hash.diff b/link-by-hash.diff index fc2f8f9..ed8bf5b 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -1,20 +1,20 @@ -After applying this patch, run these commands for a successful build: - - ./prepare-source - ./configure (optional if already run) - make - -Jason M. Felice writes: +Jason M. Felice wrote: This patch adds the --link-by-hash=DIR option, which hard links received files in a link farm arranged by MD4 file hash. The result is that the system will only store one copy of the unique contents of each file, regardless of the file's name. +To use this patch, run these commands for a successful build: + + patch -p1 length); + fname, fd2, file->length, file->u.sum); - if (!log_before_transfer) - log_item(file, &initial_stats, iflags, NULL); + log_item(log_code, file, &initial_stats, iflags, NULL); + --- old/rsync.c +++ new/rsync.c -@@ -49,6 +49,7 @@ extern int preserve_gid; - extern int inplace; +@@ -48,6 +48,7 @@ extern int inplace; extern int keep_dirlinks; extern int make_backups; + extern mode_t orig_umask; +extern char *link_by_hash_dir; extern struct stats stats; extern struct chmod_mode_struct *daemon_chmod_modes; -@@ -269,8 +270,15 @@ void finish_transfer(char *fname, char * +@@ -271,8 +272,15 @@ void finish_transfer(char *fname, char * /* move tmp file over real file */ if (verbose > 2) rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); @@ -549,7 +549,7 @@ the file's name. ret == -2 ? "copy" : "rename", --- old/rsync.h +++ new/rsync.h -@@ -640,6 +640,14 @@ struct stats { +@@ -651,6 +651,14 @@ struct stats { int current_file_index; }; @@ -566,7 +566,7 @@ the file's name. #include "byteorder.h" --- old/rsync.yo +++ new/rsync.yo -@@ -361,6 +361,7 @@ to the detailed description below for a +@@ -366,6 +366,7 @@ to the detailed description below for a --compare-dest=DIR also compare received files relative to DIR --copy-dest=DIR ... and include copies of unchanged files --link-dest=DIR hardlink to files in DIR when unchanged