Some changes to allow an unsorted file list even if the iconv option
was disabled via configure.
This commit is contained in:
13
compat.c
13
compat.c
@@ -54,16 +54,15 @@ extern char *dest_option;
|
|||||||
extern char *files_from;
|
extern char *files_from;
|
||||||
extern char *filesfrom_host;
|
extern char *filesfrom_host;
|
||||||
extern struct filter_list_struct filter_list;
|
extern struct filter_list_struct filter_list;
|
||||||
|
extern int need_unsorted_flist;
|
||||||
#ifdef ICONV_OPTION
|
#ifdef ICONV_OPTION
|
||||||
extern char *iconv_opt;
|
|
||||||
extern iconv_t ic_send, ic_recv;
|
extern iconv_t ic_send, ic_recv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These index values are for the file-list's extra-attribute array. */
|
/* These index values are for the file-list's extra-attribute array. */
|
||||||
int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx;
|
int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
int ic_ndx;
|
|
||||||
|
|
||||||
|
#ifdef ICONV_OPTION
|
||||||
int filesfrom_convert = 0;
|
int filesfrom_convert = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -247,10 +246,8 @@ void setup_protocol(int f_out,int f_in)
|
|||||||
need_messages_from_generator = 1;
|
need_messages_from_generator = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
if (need_unsorted_flist && (!am_sender || inc_recurse))
|
||||||
if (iconv_opt && (!am_sender || inc_recurse))
|
unsort_ndx = ++file_extra_cnt;
|
||||||
ic_ndx = ++file_extra_cnt;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
|
if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
|
||||||
int flags = MATCHFLG_NO_PREFIXES | MATCHFLG_DIRECTORY;
|
int flags = MATCHFLG_NO_PREFIXES | MATCHFLG_DIRECTORY;
|
||||||
|
|||||||
41
flist.c
41
flist.c
@@ -63,11 +63,10 @@ extern int copy_links;
|
|||||||
extern int copy_unsafe_links;
|
extern int copy_unsafe_links;
|
||||||
extern int protocol_version;
|
extern int protocol_version;
|
||||||
extern int sanitize_paths;
|
extern int sanitize_paths;
|
||||||
|
extern int need_unsorted_flist;
|
||||||
|
extern int unsort_ndx;
|
||||||
extern struct stats stats;
|
extern struct stats stats;
|
||||||
extern char *filesfrom_host;
|
extern char *filesfrom_host;
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
extern char *iconv_opt;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char curr_dir[MAXPATHLEN];
|
extern char curr_dir[MAXPATHLEN];
|
||||||
|
|
||||||
@@ -77,9 +76,7 @@ extern struct filter_list_struct filter_list;
|
|||||||
extern struct filter_list_struct server_filter_list;
|
extern struct filter_list_struct server_filter_list;
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
#ifdef ICONV_OPTION
|
||||||
extern int ic_ndx;
|
|
||||||
extern int filesfrom_convert;
|
extern int filesfrom_convert;
|
||||||
extern int need_unsorted_flist;
|
|
||||||
extern iconv_t ic_send, ic_recv;
|
extern iconv_t ic_send, ic_recv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -867,10 +864,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
|
|||||||
F_GROUP(file) = gid;
|
F_GROUP(file) = gid;
|
||||||
file->flags |= gid_flags;
|
file->flags |= gid_flags;
|
||||||
}
|
}
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
F_NDX(file) = flist->used + flist->ndx_start;
|
F_NDX(file) = flist->used + flist->ndx_start;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (basename != thisname) {
|
if (basename != thisname) {
|
||||||
file->dirname = lastdir;
|
file->dirname = lastdir;
|
||||||
@@ -1229,10 +1224,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
|
|||||||
if (basename_len == 0+1)
|
if (basename_len == 0+1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
F_NDX(file) = dir_count - 1;
|
F_NDX(file) = dir_count - 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@@ -1676,11 +1669,9 @@ void send_extra_file_list(int f, int at_least)
|
|||||||
flist = flist_new(0, "send_extra_file_list");
|
flist = flist_new(0, "send_extra_file_list");
|
||||||
start_write = stats.total_written;
|
start_write = stats.total_written;
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
dir_ndx = F_NDX(file);
|
dir_ndx = F_NDX(file);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
dir_ndx = send_dir_ndx;
|
dir_ndx = send_dir_ndx;
|
||||||
write_ndx(f, NDX_FLIST_OFFSET - dir_ndx);
|
write_ndx(f, NDX_FLIST_OFFSET - dir_ndx);
|
||||||
flist->parent_ndx = dir_ndx;
|
flist->parent_ndx = dir_ndx;
|
||||||
@@ -1706,22 +1697,18 @@ void send_extra_file_list(int f, int at_least)
|
|||||||
|
|
||||||
write_byte(f, 0);
|
write_byte(f, 0);
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
if (need_unsorted_flist) {
|
if (need_unsorted_flist) {
|
||||||
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
|
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
|
||||||
out_of_memory("send_extra_file_list");
|
out_of_memory("send_extra_file_list");
|
||||||
memcpy(flist->sorted, flist->files,
|
memcpy(flist->sorted, flist->files,
|
||||||
flist->used * sizeof (struct file_struct*));
|
flist->used * sizeof (struct file_struct*));
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
flist->sorted = flist->files;
|
flist->sorted = flist->files;
|
||||||
|
|
||||||
clean_flist(flist, 0);
|
clean_flist(flist, 0);
|
||||||
|
|
||||||
flist->ndx_end = flist->ndx_start + flist->used - 1;
|
flist->ndx_end = flist->ndx_start + flist->used - 1;
|
||||||
#ifdef ICONV_OPTION
|
if (!need_unsorted_flist)
|
||||||
if (!iconv_opt)
|
|
||||||
#endif
|
|
||||||
flist->ndx_end -= (dir_count - dstart);
|
flist->ndx_end -= (dir_count - dstart);
|
||||||
|
|
||||||
add_dirs_to_tree(send_dir_ndx, flist, dir_count - dstart);
|
add_dirs_to_tree(send_dir_ndx, flist, dir_count - dstart);
|
||||||
@@ -2019,7 +2006,6 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
|
|||||||
* receiving side to ask for whatever name it kept. For incremental
|
* receiving side to ask for whatever name it kept. For incremental
|
||||||
* recursion mode, the sender marks duplicate dirs so that it can
|
* recursion mode, the sender marks duplicate dirs so that it can
|
||||||
* send them together in a single file-list. */
|
* send them together in a single file-list. */
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
if (need_unsorted_flist) {
|
if (need_unsorted_flist) {
|
||||||
if (inc_recurse) {
|
if (inc_recurse) {
|
||||||
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
|
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
|
||||||
@@ -2032,9 +2018,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
|
|||||||
flist->low = 0;
|
flist->low = 0;
|
||||||
flist->high = flist->used - 1;
|
flist->high = flist->used - 1;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
flist->sorted = flist->files;
|
flist->sorted = flist->files;
|
||||||
clean_flist(flist, 0);
|
clean_flist(flist, 0);
|
||||||
}
|
}
|
||||||
@@ -2143,11 +2127,7 @@ struct file_list *recv_file_list(int f)
|
|||||||
file_total += flist->used;
|
file_total += flist->used;
|
||||||
|
|
||||||
flist->ndx_end = flist->ndx_start + flist->used - 1;
|
flist->ndx_end = flist->ndx_start + flist->used - 1;
|
||||||
if (inc_recurse
|
if (inc_recurse && !need_unsorted_flist && flist->ndx_start > 1)
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
&& !iconv_opt
|
|
||||||
#endif
|
|
||||||
&& flist->ndx_start > 1)
|
|
||||||
flist->ndx_end -= dir_flist->used - dstart;
|
flist->ndx_end -= dir_flist->used - dstart;
|
||||||
|
|
||||||
if (verbose > 2)
|
if (verbose > 2)
|
||||||
@@ -2156,7 +2136,6 @@ struct file_list *recv_file_list(int f)
|
|||||||
if (show_filelist_p())
|
if (show_filelist_p())
|
||||||
finish_filelist_progress(flist);
|
finish_filelist_progress(flist);
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
if (need_unsorted_flist) {
|
if (need_unsorted_flist) {
|
||||||
/* Create an extra array of index pointers that we can sort for
|
/* Create an extra array of index pointers that we can sort for
|
||||||
* the generator's use (for wading through the files in sorted
|
* the generator's use (for wading through the files in sorted
|
||||||
@@ -2175,9 +2154,7 @@ struct file_list *recv_file_list(int f)
|
|||||||
(dir_flist->used - dstart) * sizeof (struct file_struct*));
|
(dir_flist->used - dstart) * sizeof (struct file_struct*));
|
||||||
fsort(dir_flist->sorted + dstart, dir_flist->used - dstart);
|
fsort(dir_flist->sorted + dstart, dir_flist->used - dstart);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
flist->sorted = flist->files;
|
flist->sorted = flist->files;
|
||||||
if (inc_recurse && dir_flist->used > dstart) {
|
if (inc_recurse && dir_flist->used > dstart) {
|
||||||
dir_flist->sorted = dir_flist->files;
|
dir_flist->sorted = dir_flist->files;
|
||||||
|
|||||||
@@ -95,9 +95,7 @@ extern char *backup_suffix;
|
|||||||
extern int backup_suffix_len;
|
extern int backup_suffix_len;
|
||||||
extern struct file_list *cur_flist, *first_flist, *dir_flist;
|
extern struct file_list *cur_flist, *first_flist, *dir_flist;
|
||||||
extern struct filter_list_struct server_filter_list;
|
extern struct filter_list_struct server_filter_list;
|
||||||
#ifdef ICONV_OPTION
|
extern int unsort_ndx;
|
||||||
extern int ic_ndx;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int ignore_perishable = 0;
|
int ignore_perishable = 0;
|
||||||
int non_perishable_cnt = 0;
|
int non_perishable_cnt = 0;
|
||||||
@@ -2060,11 +2058,9 @@ void generate_files(int f_out, const char *local_name)
|
|||||||
if (!F_IS_ACTIVE(file))
|
if (!F_IS_ACTIVE(file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
ndx = F_NDX(file);
|
ndx = F_NDX(file);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
ndx = i + cur_flist->ndx_start;
|
ndx = i + cur_flist->ndx_start;
|
||||||
|
|
||||||
if (solo_file)
|
if (solo_file)
|
||||||
|
|||||||
12
hlink.c
12
hlink.c
@@ -34,11 +34,9 @@ extern int protocol_version;
|
|||||||
extern int remove_source_files;
|
extern int remove_source_files;
|
||||||
extern int stdout_format_has_i;
|
extern int stdout_format_has_i;
|
||||||
extern int maybe_ATTRS_REPORT;
|
extern int maybe_ATTRS_REPORT;
|
||||||
|
extern int unsort_ndx;
|
||||||
extern char *basis_dir[];
|
extern char *basis_dir[];
|
||||||
extern struct file_list *cur_flist;
|
extern struct file_list *cur_flist;
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
extern int ic_ndx;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SUPPORT_HARD_LINKS
|
#ifdef SUPPORT_HARD_LINKS
|
||||||
|
|
||||||
@@ -145,11 +143,9 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
|
|||||||
break;
|
break;
|
||||||
F_HL_PREV(file) = prev;
|
F_HL_PREV(file) = prev;
|
||||||
/* The linked list must use raw ndx values. */
|
/* The linked list must use raw ndx values. */
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
prev = F_NDX(file);
|
prev = F_NDX(file);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
prev = ndx_list[from] + hlink_flist->ndx_start;
|
prev = ndx_list[from] + hlink_flist->ndx_start;
|
||||||
}
|
}
|
||||||
if (prev < 0 && !inc_recurse) {
|
if (prev < 0 && !inc_recurse) {
|
||||||
@@ -163,11 +159,9 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
|
|||||||
file->flags |= FLAG_HLINK_LAST;
|
file->flags |= FLAG_HLINK_LAST;
|
||||||
F_HL_PREV(file) = prev;
|
F_HL_PREV(file) = prev;
|
||||||
if (inc_recurse && CVAL(node->data, 0) == 0) {
|
if (inc_recurse && CVAL(node->data, 0) == 0) {
|
||||||
#ifdef ICONV_OPTION
|
if (unsort_ndx)
|
||||||
if (ic_ndx)
|
|
||||||
prev = F_NDX(file);
|
prev = F_NDX(file);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
prev = ndx_list[from] + hlink_flist->ndx_start;
|
prev = ndx_list[from] + hlink_flist->ndx_start;
|
||||||
SIVAL(node->data, 1, prev);
|
SIVAL(node->data, 1, prev);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ int list_only = 0;
|
|||||||
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
|
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
|
||||||
char *batch_name = NULL;
|
char *batch_name = NULL;
|
||||||
|
|
||||||
#ifdef ICONV_OPTION
|
|
||||||
int need_unsorted_flist = 0;
|
int need_unsorted_flist = 0;
|
||||||
|
#ifdef ICONV_OPTION
|
||||||
char *iconv_opt = ICONV_OPTION;
|
char *iconv_opt = ICONV_OPTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
2
rsync.h
2
rsync.h
@@ -647,7 +647,7 @@ extern int xattrs_ndx;
|
|||||||
#define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum
|
#define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum
|
||||||
#define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num
|
#define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num
|
||||||
#define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num
|
#define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num
|
||||||
#define F_NDX(f) REQ_EXTRA(f, ic_ndx)->num
|
#define F_NDX(f) REQ_EXTRA(f, unsort_ndx)->num
|
||||||
|
|
||||||
/* These items are per-entry optional: */
|
/* These items are per-entry optional: */
|
||||||
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num /* non-dirs */
|
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num /* non-dirs */
|
||||||
|
|||||||
Reference in New Issue
Block a user