Matt McCutchen's Web Site
/
rsync
/
rsync-patches.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed failing hunks.
[rsync/rsync-patches.git]
/
detect-renamed.diff
diff --git
a/detect-renamed.diff
b/detect-renamed.diff
index
458d142
..
496e8d0
100644
(file)
--- a/
detect-renamed.diff
+++ b/
detect-renamed.diff
@@
-42,7
+42,7
@@
TODO:
extern int protocol_version;
extern int sanitize_paths;
extern struct stats stats;
extern int protocol_version;
extern int sanitize_paths;
extern struct stats stats;
-@@ -7
8,6 +79
,8 @@ static dev_t tmp_rdev;
+@@ -7
7,6 +78
,8 @@ static dev_t tmp_rdev;
static struct idev tmp_idev;
static char tmp_sum[MD4_SUM_LENGTH];
static struct idev tmp_idev;
static char tmp_sum[MD4_SUM_LENGTH];
@@
-51,7
+51,7
@@
TODO:
static char empty_sum[MD4_SUM_LENGTH];
static int flist_count_offset;
static char empty_sum[MD4_SUM_LENGTH];
static int flist_count_offset;
-@@ -2
60,6 +263
,44 @@ static mode_t from_wire_mode(int mode)
+@@ -2
59,6 +262
,44 @@ static mode_t from_wire_mode(int mode)
return mode;
}
return mode;
}
@@
-96,7
+96,7
@@
TODO:
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len);
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len);
-@@ -1
395,6 +1436
,25 @@ struct file_list *recv_file_list(int f)
+@@ -1
411,6 +1452
,25 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
clean_flist(flist, relative_paths, 1);
@@
-124,7
+124,7
@@
TODO:
--- old/generator.c
+++ new/generator.c
--- old/generator.c
+++ new/generator.c
-@@ -7
7,6 +77
,7 @@ extern char *basis_dir[];
+@@ -7
6,6 +76
,7 @@ extern char *basis_dir[];
extern int compare_dest;
extern int copy_dest;
extern int link_dest;
extern int compare_dest;
extern int copy_dest;
extern int link_dest;
@@
-132,7
+132,7
@@
TODO:
extern int whole_file;
extern int list_only;
extern int new_root_dir;
extern int whole_file;
extern int list_only;
extern int new_root_dir;
-@@ -9
3,15 +94,18
@@ extern char *backup_dir;
+@@ -9
1,16 +92,19
@@ extern char *backup_dir;
extern char *backup_suffix;
extern int backup_suffix_len;
extern struct file_list *the_file_list;
extern char *backup_suffix;
extern int backup_suffix_len;
extern struct file_list *the_file_list;
@@
-145,6
+145,7
@@
TODO:
static int deletion_count = 0; /* used to implement --max-delete */
+static int unexplored_dirs = 1;
static FILE *delete_delay_fp = NULL;
static int deletion_count = 0; /* used to implement --max-delete */
+static int unexplored_dirs = 1;
static FILE *delete_delay_fp = NULL;
+ static BOOL solo_file = 0;
-/* For calling delete_item() and delete_dir_contents(). */
+/* For calling delete_item(), delete_dir_contents(), and delete_in_dir(). */
-/* For calling delete_item() and delete_dir_contents(). */
+/* For calling delete_item(), delete_dir_contents(), and delete_in_dir(). */
@@
-152,7
+153,7
@@
TODO:
#define DEL_RECURSE (1<<1) /* recurse */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
#define DEL_RECURSE (1<<1) /* recurse */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -12
3,11 +127
,121 @@ static int is_backup_file(char *fn)
+@@ -12
2,11 +126
,121 @@ static int is_backup_file(char *fn)
return k > 0 && strcmp(fn+k, backup_suffix) == 0;
}
return k > 0 && strcmp(fn+k, backup_suffix) == 0;
}
@@
-274,7
+275,7
@@
TODO:
*/
static enum delret delete_item(char *fbuf, int mode, char *replace, int flags)
{
*/
static enum delret delete_item(char *fbuf, int mode, char *replace, int flags)
{
-@@ -14
9,6 +263
,8 @@ static enum delret delete_item(char *fbu
+@@ -14
8,6 +262
,8 @@ static enum delret delete_item(char *fbu
goto check_ret;
/* OK: try to delete the directory. */
}
goto check_ret;
/* OK: try to delete the directory. */
}
@@
-283,7
+284,7
@@
TODO:
if (!replace && max_delete >= 0 && ++deletion_count > max_delete)
return DR_AT_LIMIT;
if (!replace && max_delete >= 0 && ++deletion_count > max_delete)
return DR_AT_LIMIT;
-@@ -19
5,6 +311
,8 @@ static enum delret delete_item(char *fbu
+@@ -19
4,6 +310
,8 @@ static enum delret delete_item(char *fbu
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
@@
-292,7
+293,7
@@
TODO:
*/
static enum delret delete_dir_contents(char *fname, int flags)
{
*/
static enum delret delete_dir_contents(char *fname, int flags)
{
-@@ -25
1,6 +369
,8 @@ static enum delret delete_dir_contents(c
+@@ -25
0,6 +368
,8 @@ static enum delret delete_dir_contents(c
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
@@
-301,7
+302,7
@@
TODO:
if (delete_item(fname, fp->mode, NULL, flags) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
}
if (delete_item(fname, fp->mode, NULL, flags) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
}
-@@ -33
5,15 +455
,19 @@ static void delayed_deletions(char *delb
+@@ -33
4,15 +454
,19 @@ static void delayed_deletions(char *delb
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
@@
-324,7
+325,7
@@
TODO:
int dlen, i;
if (!flist) {
int dlen, i;
if (!flist) {
-@@ -35
7,6 +481
,8 @@ static void delete_in_dir(struct file_li
+@@ -35
6,6 +480
,8 @@ static void delete_in_dir(struct file_li
if (verbose > 2)
rprintf(FINFO, "delete_in_dir(%s)\n", fbuf);
if (verbose > 2)
rprintf(FINFO, "delete_in_dir(%s)\n", fbuf);
@@
-333,7
+334,7
@@
TODO:
if (allowed_lull)
maybe_send_keepalive();
if (allowed_lull)
maybe_send_keepalive();
-@@ -36
4,12 +490
,14 @@ static void delete_in_dir(struct file_li
+@@ -36
3,12 +489
,14 @@ static void delete_in_dir(struct file_li
return; /* Impossible... */
if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) {
return; /* Impossible... */
if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) {
@@
-353,7
+354,7
@@
TODO:
}
while (cur_depth >= file->dir.depth && cur_depth >= min_depth)
}
while (cur_depth >= file->dir.depth && cur_depth >= min_depth)
-@@ -3
80,6 +508
,9 @@ static void delete_in_dir(struct file_li
+@@ -3
79,6 +507
,9 @@ static void delete_in_dir(struct file_li
dlen = strlen(fbuf);
filt_array[cur_depth] = push_local_filters(fbuf, dlen);
dlen = strlen(fbuf);
filt_array[cur_depth] = push_local_filters(fbuf, dlen);
@@
-363,7
+364,7
@@
TODO:
if (one_file_system) {
if (file->flags & FLAG_TOP_DIR)
filesystem_dev = stp->st_dev;
if (one_file_system) {
if (file->flags & FLAG_TOP_DIR)
filesystem_dev = stp->st_dev;
-@@ -38
9,6 +520
,11 @@ static void delete_in_dir(struct file_li
+@@ -38
8,6 +519
,11 @@ static void delete_in_dir(struct file_li
dirlist = get_dirlist(fbuf, dlen, 0);
dirlist = get_dirlist(fbuf, dlen, 0);
@@
-375,7
+376,7
@@
TODO:
/* If an item in dirlist is not found in flist, delete it
* from the filesystem. */
for (i = dirlist->count; i--; ) {
/* If an item in dirlist is not found in flist, delete it
* from the filesystem. */
for (i = dirlist->count; i--; ) {
-@@ -40
1,15 +537
,22 @@ static void delete_in_dir(struct file_li
+@@ -40
0,15 +536
,22 @@ static void delete_in_dir(struct file_li
f_name(fp, NULL));
continue;
}
f_name(fp, NULL));
continue;
}
@@
-401,7
+402,7
@@
TODO:
flist_free(dirlist);
}
flist_free(dirlist);
}
-@@ -43
9,9 +582
,9 @@ static void do_delete_pass(struct file_l
+@@ -43
8,9 +581
,9 @@ static void do_delete_pass(struct file_l
|| !S_ISDIR(st.st_mode))
continue;
|| !S_ISDIR(st.st_mode))
continue;
@@
-413,7
+414,7
@@
TODO:
if (do_progress && !am_server)
rprintf(FINFO, " \r");
if (do_progress && !am_server)
rprintf(FINFO, " \r");
-@@ -9
66,6 +1109
,7 @@ static int try_dests_non(struct file_str
+@@ -9
71,6 +1114
,7 @@ static int try_dests_non(struct file_str
return j;
}
return j;
}
@@
-421,7
+422,7
@@
TODO:
static int phase = 0;
/* Acts on the_file_list->file's ndx'th item, whose name is fname. If a dir,
static int phase = 0;
/* Acts on the_file_list->file's ndx'th item, whose name is fname. If a dir,
-@@ -115
2,8 +1296
,12 @@ static void recv_generator(char *fname,
+@@ -115
7,8 +1301
,12 @@ static void recv_generator(char *fname,
if (real_ret != 0 && one_file_system)
real_st.st_dev = filesystem_dev;
if (delete_during && f_out != -1 && !phase && dry_run < 2
if (real_ret != 0 && one_file_system)
real_st.st_dev = filesystem_dev;
if (delete_during && f_out != -1 && !phase && dry_run < 2
@@
-436,10
+437,10
@@
TODO:
return;
}
return;
}
-@@ -1406,8 +1554,14 @@ static void recv_generator(char *fname,
- && hard_link_check(file, ndx, fname, statret, &st,
+@@ -1429,8 +1577,14 @@ static void recv_generator(char *fname,
itemizing, code, HL_SKIP))
return;
itemizing, code, HL_SKIP))
return;
+ #endif
- if (stat_errno == ENOENT)
+ if (stat_errno == ENOENT) {
+ if (detect_renamed && unexplored_dirs > 0
- if (stat_errno == ENOENT)
+ if (stat_errno == ENOENT) {
+ if (detect_renamed && unexplored_dirs > 0
@@
-452,7
+453,7
@@
TODO:
rsyserr(FERROR, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
return;
rsyserr(FERROR, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
return;
-@@ -1
593,13 +1747
,19 @@ void generate_files(int f_out, struct fi
+@@ -1
619,13 +1773
,19 @@ void generate_files(int f_out, struct fi
(long)getpid(), flist->count);
}
(long)getpid(), flist->count);
}
@@
-473,7
+474,7
@@
TODO:
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -16
54,7 +1814
,23 @@ void generate_files(int f_out, struct fi
+@@ -16
82,7 +1842
,23 @@ void generate_files(int f_out, struct fi
}
recv_generator(NULL, NULL, 0, 0, 0, code, -1);
if (delete_during)
}
recv_generator(NULL, NULL, 0, 0, 0, code, -1);
if (delete_during)