Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added csum-length option
[rsync/rsync.git]
/
main.c
diff --git
a/main.c
b/main.c
index
0af90e5
..
95c6fde
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-44,6
+44,7
@@
int ignore_times=0;
int delete_mode=0;
int one_file_system=0;
int remote_version=0;
int delete_mode=0;
int one_file_system=0;
int remote_version=0;
+int csum_length=SUM_LENGTH;
int am_server = 0;
static int sender = 0;
int am_server = 0;
static int sender = 0;
@@
-88,6
+89,7
@@
static void server_options(char **args,int *argc)
int ac = *argc;
static char argstr[50];
static char bsize[30];
int ac = *argc;
static char argstr[50];
static char bsize[30];
+ static char slength[30];
int i, x;
args[ac++] = "--server";
int i, x;
args[ac++] = "--server";
@@
-135,6
+137,11
@@
static void server_options(char **args,int *argc)
sprintf(bsize,"-B%d",block_size);
args[ac++] = bsize;
}
sprintf(bsize,"-B%d",block_size);
args[ac++] = bsize;
}
+
+ if (csum_length != SUM_LENGTH) {
+ sprintf(slength,"--csum-length=%d",csum_length);
+ args[ac++] = slength;
+ }
if (delete_mode)
args[ac++] = "--delete";
if (delete_mode)
args[ac++] = "--delete";
@@
-369,6
+376,7
@@
static void usage(FILE *f)
fprintf(f," --exclude FILE exclude file FILE\n");
fprintf(f," --exclude-from FILE exclude files listed in FILE\n");
fprintf(f," --suffix SUFFIX override backup suffix\n");
fprintf(f," --exclude FILE exclude file FILE\n");
fprintf(f," --exclude-from FILE exclude files listed in FILE\n");
fprintf(f," --suffix SUFFIX override backup suffix\n");
+ fprintf(f," --csum-length LENGTH set the checksum length\n");
fprintf(f," --version print version number\n");
fprintf(f,"\n");
fprintf(f," --version print version number\n");
fprintf(f,"\n");
@@
-377,7
+385,7
@@
static void usage(FILE *f)
}
enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE,
}
enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE,
- OPT_EXCLUDE_FROM,OPT_DELETE,OPT_RSYNC_PATH};
+ OPT_EXCLUDE_FROM,OPT_DELETE,OPT_RSYNC_PATH
,OPT_CSUM_LENGTH
};
static char *short_options = "oblpguDCtcahvrIxne:B:";
static char *short_options = "oblpguDCtcahvrIxne:B:";
@@
-389,6
+397,7
@@
static struct option long_options[] = {
{"exclude", 1, 0, OPT_EXCLUDE},
{"exclude-from",1, 0, OPT_EXCLUDE_FROM},
{"rsync-path", 1, 0, OPT_RSYNC_PATH},
{"exclude", 1, 0, OPT_EXCLUDE},
{"exclude-from",1, 0, OPT_EXCLUDE_FROM},
{"rsync-path", 1, 0, OPT_RSYNC_PATH},
+ {"csum-length", 1, 0, OPT_CSUM_LENGTH},
{"one-file-system",0, 0, 'x'},
{"ignore-times",0, 0, 'I'},
{"help", 0, 0, 'h'},
{"one-file-system",0, 0, 'x'},
{"ignore-times",0, 0, 'I'},
{"help", 0, 0, 'h'},
@@
-445,6
+454,11
@@
int main(int argc,char *argv[])
rsync_path = optarg;
break;
rsync_path = optarg;
break;
+ case OPT_CSUM_LENGTH:
+ csum_length = atoi(optarg);
+ csum_length = MIN(csum_length,SUM_LENGTH);
+ break;
+
case 'I':
ignore_times = 1;
break;
case 'I':
ignore_times = 1;
break;