[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sun Jun 28 01:06:41 UTC 2020


The branch, master has been updated
       via  0eec25f7 Some patch-update & vim ft improvements
       via  3a6f0600 Improve the output when a negotiation fails.
       via  f805d1a7 More NEWS and man page changes.
      from  ab29ee9c Negotation env lists can specify "client & server"

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0eec25f75b044b00d3ba9ac445402b130c694ccb
Author: Wayne Davison <wayne at opencoder.net>
Date:   Sat Jun 27 12:06:13 2020 -0700

    Some patch-update & vim ft improvements
    
    - Stash off some gen files when switching patch branches.
    - Set the filetype in "env -S" files that vim can't handle.

commit 3a6f06003cdd29e9385dba3a9673122e0e356c76
Author: Wayne Davison <wayne at opencoder.net>
Date:   Sat Jun 27 10:39:16 2020 -0700

    Improve the output when a negotiation fails.

commit f805d1a7f7e6a2d14febc532bb357a10c46c8972
Author: Wayne Davison <wayne at opencoder.net>
Date:   Sat Jun 27 10:39:12 2020 -0700

    More NEWS and man page changes.

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                  |  1 +
 NEWS.md                     | 17 ++++++++++-----
 cleanup.c                   |  7 ++++++-
 compat.c                    | 50 +++++++++++++++++++++++++++++++++------------
 packaging/branch-from-patch |  2 +-
 packaging/patch-update      | 42 +++++++++++++++++++++++++++++++++++--
 packaging/release-rsync     |  2 +-
 packaging/var-checker       |  2 +-
 rsync.1.md                  |  2 ++
 9 files changed, 101 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index 70061765..62cf9a54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,4 +49,5 @@ aclocal.m4
 /testsuite/xattrs-hlink.test
 /patches
 /SaVeDiR
+/.gen-stash
 .deps
diff --git a/NEWS.md b/NEWS.md
index d579b955..8b745371 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -20,8 +20,8 @@ Protocol: 31 (unchanged)
    the same environment variables the client uses.  Allow the env vars
    to be divided into "client list & server list" by the "`&`" char.
 
- - Simplify how the negotiation environment variables apply to older rsync
-   versions.
+ - Simplify how the negotiation environment variables apply when interacting
+   with an older rsync version.
 
  - Do not allow a negotiated checksum or compression choice of "none" unless
    the user authorized it via an environment variable or command-line option.
@@ -37,11 +37,17 @@ Protocol: 31 (unchanged)
    die when out of memory.  This eliminated some caller-side check-and-die
    code and added some missing sanity-checking of allocations.
 
- - Preparing for an upcoming xxHash release that provides new XXH3 & XXH128
-   hashing routines (disabled until their code is finalized).
-
  - Improved the man page a bit more.
 
+### PACKAGING RELATED:
+
+ - Prepared the checksum code for an upcoming xxHash release that provides new
+   XXH3 & XXH128 checksum routines.  These will not be compiled into rsync
+   until the xxhash v0.8.0 include files are installed on the build host, and
+   that release is a few weeks away at the time this was written.  So, if it's
+   now the future and you have packaged and installed xxhash-0.8.0-devel, a
+   fresh rebuild of rsync 3.2.2 will give you the new checksum routines.
+
 ------------------------------------------------------------------------------
 <a name="3.2.1"></a>
 
@@ -4144,6 +4150,7 @@ Protocol: 25 (changed)
 
 | RELEASE DATE | VER.   | DATE OF COMMIT\* | PROTOCOL    |
 |--------------|--------|------------------|-------------|
+| ?? Jun 2020  | 3.2.2  |                  | 31          |
 | 22 Jun 2020  | 3.2.1  |                  | 31          |
 | 19 Jun 2020  | 3.2.0  |                  | 31          |
 | 28 Jan 2018  | 3.1.3  |                  | 31          |
diff --git a/cleanup.c b/cleanup.c
index cf8330ac..ab981ec7 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -221,8 +221,13 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
 		/* If line < 0, this exit is after a MSG_ERROR_EXIT event, so
 		 * we don't want to output a duplicate error. */
 		if ((exit_code && line > 0)
-		 || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1))))
+		 || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1)))) {
+#ifdef HAVE_USLEEP /* Try for a teeny delay if both sender & receiver are sending a msg at the same time. */
+			if (am_server && exit_code)
+				usleep(50);
+#endif
 			log_exit(exit_code, exit_file, exit_line);
+		}
 
 #include "case_N.h"
 		switch_step++;
diff --git a/compat.c b/compat.c
index bf0b4e6d..6d260f0d 100644
--- a/compat.c
+++ b/compat.c
@@ -313,6 +313,9 @@ static int parse_nni_str(struct name_num_obj *nno, const char *from, char *tobuf
 	return to - tobuf;
 }
 
+/* This routine is always called with a tmpbuf of MAX_NSTR_STRLEN length, but the
+ * buffer may be pre-populated with a "len" length string to use OR a len of -1
+ * to tell us to read a string from the fd. */
 static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf, int len)
 {
 	struct name_num_item *ret = NULL;
@@ -328,23 +331,26 @@ static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf,
 	}
 
 	if (len > 0) {
+		struct name_num_item *nni;
 		int best = nno->saw_len; /* We want best == 1 from the client list, so start with a big number. */
-		char *tok;
-		if (am_server) {
-			int j;
-			/* Since we're parsing client names, anything in our list that we parse first is #1. */
-			for (j = 0; j < nno->saw_len; j++) {
-				if (nno->saw[j])
-					nno->saw[j] = 1;
-			}
-		}
-		for (tok = strtok(tmpbuf, " \t"); tok; tok = strtok(NULL, " \t")) {
-			struct name_num_item *nni = get_nni_by_name(nno, tok, -1);
+		char *space, *tok = tmpbuf;
+		while (tok) {
+			while (*tok == ' ') tok++; /* Should be unneeded... */
+			if (!*tok)
+				break;
+			if ((space = strchr(tok, ' ')) != NULL)
+				*space = '\0';
+			nni = get_nni_by_name(nno, tok, -1);
+			if (space) {
+				*space = ' ';
+				tok = space + 1;
+			} else
+				tok = NULL;
 			if (!nni || !nno->saw[nni->num] || best <= nno->saw[nni->num])
 				continue;
 			ret = nni;
 			best = nno->saw[nni->num];
-			if (best == 1)
+			if (best == 1 || am_server) /* The server side stops at the first acceptable client choice */
 				break;
 		}
 		if (ret) {
@@ -356,8 +362,26 @@ static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf,
 		}
 	}
 
-	if (!am_server || !do_negotiated_strings)
+	if (!am_server || !do_negotiated_strings) {
+		char *cp = tmpbuf;
+		int j;
 		rprintf(FERROR, "Failed to negotiate a %s choice.\n", nno->type);
+		rprintf(FERROR, "%s list: %s\n", am_server ? "Client" : "Server", tmpbuf);
+		/* Recreate our original list from the saw values. This can't overflow our huge
+		 * buffer because we don't have enough valid entries to get anywhere close. */
+		for (j = 1; j <= nno->saw_len; j++) {
+			struct name_num_item *nni;
+			for (nni = nno->list; nni->name; nni++) {
+				if (nno->saw[nni->num] == j) {
+					*cp++ = ' ';
+					cp += strlcpy(cp, nni->name, MAX_NSTR_STRLEN - (cp - tmpbuf));
+					break;
+				}
+			}
+		}
+		rprintf(FERROR, "%s list:%s\n", am_server ? "Server" : "Client", tmpbuf);
+	}
+
 	exit_cleanup(RERR_UNSUPPORTED);
 }
 
diff --git a/packaging/branch-from-patch b/packaging/branch-from-patch
index dfd3a29a..440b5835 100755
--- a/packaging/branch-from-patch
+++ b/packaging/branch-from-patch
@@ -171,4 +171,4 @@ if __name__ == '__main__':
     args = parser.parse_args()
     main()
 
-# vim: sw=4 et
+# vim: sw=4 et ft=python
diff --git a/packaging/patch-update b/packaging/patch-update
index c6b51527..0970d299 100755
--- a/packaging/patch-update
+++ b/packaging/patch-update
@@ -31,6 +31,10 @@ def main():
 
     starting_branch, args.base_branch = check_git_state(args.base_branch, not args.skip_check, args.patches_dir)
 
+    gen_stash(starting_branch)
+    if starting_branch == 'master':
+        cmd_run('md5sum configure.ac >.gen-stash/configure.ac.sum')
+
     master_commit = latest_git_hash(args.base_branch)
 
     if args.gen:
@@ -95,6 +99,8 @@ def main():
         time.sleep(1)
     cmd_chk(['git', 'checkout', starting_branch])
 
+    gen_unstash(starting_branch)
+
 
 def update_patch(patch):
     global last_touch
@@ -115,13 +121,16 @@ def update_patch(patch):
 
     while args.gen and last_touch >= time.time():
         time.sleep(1)
-    s = cmd_run(f"git checkout patch/{args.base_branch}/{patch}".split())
+
+    branch = f"patch/{args.base_branch}/{patch}"
+    s = cmd_run(['git', 'checkout', branch])
     if s.returncode != 0:
         return 0
 
     s = cmd_run(['git', 'merge', based_on])
     ok = s.returncode == 0
     if not ok or args.shell:
+        gen_unstash(branch)
         m = re.search(r'([^/]+)$', parent)
         parent_dir = m[1]
         if not ok:
@@ -138,6 +147,7 @@ def update_patch(patch):
             if is_clean:
                 break
             print(status_txt, end='')
+        gen_stash(branch)
 
     with open(f"{args.patches_dir}/{patch}.diff", 'w', encoding='utf-8') as fh:
         fh.write(description[patch])
@@ -191,6 +201,34 @@ def update_patch(patch):
     return 1
 
 
+# The autoconf cache dir can totally mess up if 2 different *.ac files have the same mtime!
+def gen_stash_prep(branch):
+    if os.path.isdir('autom4te.cache'):
+        shutil.rmtree('autom4te.cache')
+    return '.gen-stash/' + branch.replace('/', '%') + '.tar.gz'
+
+
+def gen_stash(branch):
+    files = 'configure.sh config.h.in Makefile'.split()
+    for fn in files:
+        if not os.path.exists(fn):
+            return
+    if not os.path.isdir('.gen-stash'):
+        os.mkdir('.gen-stash', 0o700)
+    tar_fn = gen_stash_prep(branch)
+    cmd_run(['./prepare-source'])
+    cmd_chk(['tar', 'czf', tar_fn, *files])
+
+
+def gen_unstash(branch):
+    tar_fn = gen_stash_prep(branch)
+    if os.path.exists(tar_fn):
+        cmd_chk(['tar', 'xf', tar_fn])
+    out, rc = cmd_txt_status('md5sum --status -c .gen-stash/configure.ac.sum'.split())
+    if rc:
+        print('*' * 10, "configure.ac differs from master version", '*' * 10)
+
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description="Turn a git branch back into a diff files in the patches dir.", add_help=False)
     parser.add_argument('--branch', '-b', dest='base_branch', metavar='BASE_BRANCH', default='master', help="The branch the patch is based on. Default: master.")
@@ -207,4 +245,4 @@ if __name__ == '__main__':
         args.patches_dir = args.gen
     main()
 
-# vim: sw=4 et
+# vim: sw=4 et ft=python
diff --git a/packaging/release-rsync b/packaging/release-rsync
index 3afa79bd..2ae5eb4c 100755
--- a/packaging/release-rsync
+++ b/packaging/release-rsync
@@ -381,4 +381,4 @@ if __name__ == '__main__':
     args = parser.parse_args()
     main()
 
-# vim: sw=4 et
+# vim: sw=4 et ft=python
diff --git a/packaging/var-checker b/packaging/var-checker
index e021127c..fe7491df 100755
--- a/packaging/var-checker
+++ b/packaging/var-checker
@@ -84,4 +84,4 @@ if __name__ == '__main__':
     args = parser.parse_args()
     main()
 
-# vim: sw=4 et
+# vim: sw=4 et ft=python
diff --git a/rsync.1.md b/rsync.1.md
index 3708e1e1..e75544e9 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -1475,6 +1475,8 @@ your home directory (remove the '=' for that).
     The checksum options that you may be able to use are:
 
     - `auto` (the default)
+    - `xxh128`
+    - `xxh3`
     - `xxh64` (aka xxhash)
     - `md5`
     - `md4`


-- 
The rsync repository.



More information about the rsync-cvs mailing list