[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Wed Jun 10 18:31:35 UTC 2020
The branch, master has been updated
via f8683063 Fix a couple batchfile issues.
via 7c83eb6e Improve gensend rule & list of PHONY targets.
from 58e8ecf4 Improvements for release process; a gensend hook.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f8683063fbe22eddc01146c78de1c7e72863ebbc
Author: Wayne Davison <wayne at opencoder.net>
Date: Wed Jun 10 11:05:09 2020 -0700
Fix a couple batchfile issues.
commit 7c83eb6e63d35b34a59048d069356489f35594e8
Author: Wayne Davison <wayne at opencoder.net>
Date: Wed Jun 10 09:44:23 2020 -0700
Improve gensend rule & list of PHONY targets.
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 26 +++++++++++++++++++++-----
batch.c | 20 +++++++++++++-------
checksum.c | 2 +-
main.c | 9 +++++++--
4 files changed, 42 insertions(+), 15 deletions(-)
Changeset truncated at 500 lines:
diff --git a/Makefile.in b/Makefile.in
index 33f78538..dc0cb0b8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -68,8 +68,10 @@ CHECK_OBJS=tls.o testrun.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.
$(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
@OBJ_RESTORE@
+.PHONY: all
all: Makefile rsync$(EXEEXT) stunnel-rsyncd.conf man
+.PHONY: install
install: all
-${MKDIR_P} ${DESTDIR}${bindir}
-${MKDIR_P} ${DESTDIR}${libdir}
@@ -147,14 +149,16 @@ T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o util2.o t_stub.o lib/compat.o lib/snp
t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
+.PHONY: conf
+conf: configure.sh config.h.in
+
+.PHONY: gen
gen: conf proto.h man
+.PHONY: gensend
gensend: gen
rsync -aic $(GENFILES) $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/
-conf:
- cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
-
aclocal.m4: $(srcdir)/m4/*.m4
aclocal -I $(srcdir)/m4
@@ -185,6 +189,7 @@ configure.sh config.h.in: configure.ac aclocal.m4
fi \
fi
+.PHONY: reconfigure
reconfigure: configure.sh
./config.status --recheck
./config.status
@@ -207,6 +212,7 @@ Makefile: Makefile.in config.status configure.sh config.h.in
stunnel-rsyncd.conf: $(srcdir)/stunnel-rsyncd.conf.in Makefile
sed 's;\@bindir\@;$(bindir);g' <$(srcdir)/stunnel-rsyncd.conf.in >stunnel-rsyncd.conf
+.PHONY: proto
proto: proto.h-tstamp
proto.h: proto.h-tstamp
@@ -215,6 +221,7 @@ proto.h: proto.h-tstamp
proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c config.h
awk -f $(srcdir)/mkproto.awk $(srcdir)/*.c $(srcdir)/lib/compat.c
+.PHONY: man
man: rsync.1 rsync-ssl.1 rsyncd.conf.5
rsync.1: rsync.1.md md2man NEWS.md Makefile
@@ -226,16 +233,19 @@ rsync-ssl.1: rsync-ssl.1.md md2man NEWS.md Makefile
rsyncd.conf.5: rsyncd.conf.5.md md2man NEWS.md Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsyncd.conf.5.md
+.PHONY: clean
clean: cleantests
rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
rounding rounding.h *.old
+.PHONY: cleantests
cleantests:
rm -rf ./testtmp*
# We try to delete built files from both the source and build
# directories, just in case somebody previously configured things in
# the source directory.
+.PHONY: distclean
distclean: clean
rm -f Makefile config.h config.status
rm -f stunnel-rsyncd.conf
@@ -251,14 +261,14 @@ distclean: clean
# this target is really just for my use. It only works on a limited
# range of machines and is used to produce a list of potentially
# dead (ie. unused) functions in the code. (tridge)
+.PHONY: finddead
finddead:
nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
comm -13 nmused.txt nmfns.txt
# 'check' is the GNU name, 'test' is the name for everybody else :-)
-.PHONY: check test
-
+.PHONY: test
test: check
# There seems to be no standard way to specify some variables as
@@ -271,12 +281,15 @@ test: check
# catch Bash-isms earlier even if we're running on GNU. Of course, we
# might lose in the future where POSIX diverges from old sh.
+.PHONY: check
check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
+.PHONY: check29
check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
+.PHONY: check30
check30: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=30
@@ -297,6 +310,7 @@ testsuite/xattrs-hlink.test:
# check a version installed from a binary or some other source tree,
# if you want.
+.PHONY: installcheck
installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
@@ -307,10 +321,12 @@ installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
splint:
splint +unixlib +gnuextensions -weak rsync.c
+.PHONY: doxygen
doxygen:
cd $(srcdir) && rm dox/html/* && doxygen
# for maintainers only
+.PHONY: doxygen-upload
doxygen-upload:
rsync -avzv $(srcdir)/dox/html/ --delete \
$${SAMBA_HOST-samba.org}:/home/httpd/html/rsync/doxygen/head/
diff --git a/batch.c b/batch.c
index b60752fc..b81d9556 100644
--- a/batch.c
+++ b/batch.c
@@ -38,6 +38,7 @@ extern int do_compression;
extern int inplace;
extern int append_mode;
extern int write_batch;
+extern int xfersum_type;
extern int protocol_version;
extern int raw_argc, cooked_argc;
extern char **raw_argv, **cooked_argv;
@@ -256,7 +257,7 @@ void open_batch_files(void)
* (hopefully) work. */
void write_batch_shell_file(void)
{
- int i, len, err = 0;
+ int i, j, len, err = 0;
char *p, *p2;
/* Write argvs info to BATCH.sh file */
@@ -273,15 +274,20 @@ void write_batch_shell_file(void)
* do a string-based negotation (since we don't write them into the file). */
if (do_compression)
err |= write_opt("--compress-choice", compress_choice);
- err |= write_opt("--checksum-choice", checksum_choice);
+ if (strchr(checksum_choice, ',') || xfersum_type != parse_csum_name(NULL, -1))
+ err |= write_opt("--checksum-choice", checksum_choice);
+
+ /* Elide the filename args from the option list, but scan for them in reverse. */
+ for (i = raw_argc-1, j = cooked_argc-1; i > 0 && j >= 0; i--) {
+ if (strcmp(raw_argv[i], cooked_argv[j]) == 0) {
+ raw_argv[i] = NULL;
+ j--;
+ }
+ }
for (i = 1; i < raw_argc; i++) {
- p = raw_argv[i];
- if (cooked_argc && p[0] == cooked_argv[0][0] && strcmp(p, cooked_argv[0]) == 0) {
- cooked_argv++;
- cooked_argc--;
+ if (!(p = raw_argv[i]))
continue;
- }
if (strncmp(p, "--files-from", 12) == 0
|| strncmp(p, "--filter", 8) == 0
|| strncmp(p, "--include", 9) == 0
diff --git a/checksum.c b/checksum.c
index d7b2ebdd..87e83658 100644
--- a/checksum.c
+++ b/checksum.c
@@ -54,7 +54,7 @@ struct name_num_obj valid_checksums = {
int xfersum_type = 0; /* used for the file transfer checksums */
int checksum_type = 0; /* used for the pre-transfer (--checksum) checksums */
-static int parse_csum_name(const char *name, int len)
+int parse_csum_name(const char *name, int len)
{
struct name_num_item *nni;
diff --git a/main.c b/main.c
index 98bbaa68..155b178c 100644
--- a/main.c
+++ b/main.c
@@ -1706,8 +1706,13 @@ int main(int argc,char *argv[])
option_error();
exit_cleanup(RERR_SYNTAX);
}
- cooked_argc = argc;
- cooked_argv = argv;
+ if (write_batch) {
+ int j;
+ cooked_argc = argc;
+ cooked_argv = new_array(char*, argc+1);
+ for (j = 0; j <= argc; j++)
+ cooked_argv[j] = argv[j];
+ }
SIGACTMASK(SIGINT, sig_int);
SIGACTMASK(SIGHUP, sig_int);
--
The rsync repository.
More information about the rsync-cvs
mailing list