The branch, master has been updated via 3b719d1d Improve JSON output a bit more. via ebe1af74 Make use of -VV when checking rsync capabilities. from de6848ed Re-run the exclude test using lsh.sh pull.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 3b719d1d6e914a2ad29ad0dae5e24d64f71ae68b Author: Wayne Davison <wa...@opencoder.net> Date: Thu Oct 20 10:54:14 2022 -0700 Improve JSON output a bit more. commit ebe1af749cf8debca9ca90f09306a67cac9c9d4d Author: Wayne Davison <wa...@opencoder.net> Date: Thu Oct 20 09:02:28 2022 -0700 Make use of -VV when checking rsync capabilities. ----------------------------------------------------------------------- Summary of changes: NEWS.md | 7 ++++--- support/json-rsync-version | 25 +++++++++++++++++++++---- testsuite/acls-default.test | 2 +- testsuite/acls.test | 2 +- testsuite/atimes.test | 2 +- testsuite/chown.test | 2 +- testsuite/crtimes.test | 2 +- testsuite/daemon.test | 2 +- testsuite/devices.test | 4 ++-- testsuite/itemize.test | 4 ++-- testsuite/xattrs.test | 2 +- usage.c | 2 +- 12 files changed, 37 insertions(+), 19 deletions(-) Changeset truncated at 500 lines: diff --git a/NEWS.md b/NEWS.md index 24862dd0..ad1aaee0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -29,18 +29,19 @@ environment var for how to customize this. - Improved the xattr hash table to use a 64-bit key without slowing down the - key's computation. This should make extra sure that a collision doesn't + key's computation. This should make extra sure that a hash collision doesn't happen. - If the `--version` option is repeated (e.g. `-VV`) then the information is - output in a (still fairly readable) JSON format. Client side only. + output in a (still readable) JSON format. Client side only. - The script `support/json-rsync-version` is available to get the JSON style version output from any rsync. The script accepts either text on stdin **or** an arg that specifies an rsync executable to run with a doubled `--version` option. If the text we get isn't already in JSON format, it is converted. Newer rsync versions will provide more complete json info than - older rsync versions. + older rsync versions. Various tweaks are made to keep the flag names + consistent across versions. - The [`use chroot`](rsyncd.conf.5#) daemon parameter now defaults to "unset" so that rsync can use chroot when it works and a sanitized copy when chroot diff --git a/support/json-rsync-version b/support/json-rsync-version index bf5684b7..31fed7f1 100755 --- a/support/json-rsync-version +++ b/support/json-rsync-version @@ -2,6 +2,17 @@ import sys, argparse, subprocess, json +TWEAK_NAME = { + 'asm': 'asm_roll', + 'ASM': 'asm_roll', + 'hardlink_special': 'hardlink_specials', + 'protect_args': 'secluded_args', + 'protected_args': 'secluded_args', + 'SIMD': 'SIMD_roll', + } + +MOVE_OPTIM = set('asm_roll SIMD_roll'.split()) + def main(): if not args.rsync or args.rsync == '-': ver_out = sys.stdin.read().strip() @@ -11,6 +22,7 @@ def main(): print(ver_out) return info = { } + misplaced_optims = { } for line in ver_out.splitlines(): if line.startswith('rsync '): prog, vstr, ver, pstr, vstr2, proto = line.split() @@ -40,13 +52,16 @@ def main(): elif val.endswith('-bit'): var = var[:-1] + '_bits' val = int(val.split('-')[0]) - if var == 'protect-args': - var = 'secluded-args' else: var = x val = True var = var.replace(' ', '_').replace('-', '_') - info[sect_name][var] = val + if var in TWEAK_NAME: + var = TWEAK_NAME[var] + if sect_name[0] != 'o' and var in MOVE_OPTIM: + misplaced_optims[var] = val + else: + info[sect_name][var] = val else: info[sect_name] += [ x for x in line.split() if not x.startswith('(') ] elif line == '': @@ -58,10 +73,12 @@ def main(): for chk in 'capabilities optimizations'.split(): if chk not in info: info[chk] = { } + if misplaced_optims: + info['optimizations'].update(misplaced_optims) for chk in 'checksum_list compress_list daemon_auth_list'.split(): if chk not in info: info[chk] = [ ] - info['license'] = 'GPL3' + info['license'] = 'GPLv3' if ver[0] == '3' else 'GPLv2' info['caveat'] = 'rsync comes with ABSOLUTELY NO WARRANTY' print(json.dumps(info)) diff --git a/testsuite/acls-default.test b/testsuite/acls-default.test index a0a482ce..d8fba7fe 100644 --- a/testsuite/acls-default.test +++ b/testsuite/acls-default.test @@ -7,7 +7,7 @@ . $suitedir/rsync.fns -$RSYNC --version | grep "[, ] ACLs" >/dev/null || test_skipped "Rsync is configured without ACL support" +$RSYNC -VV | grep '"ACLs": true' >/dev/null || test_skipped "Rsync is configured without ACL support" case "$setfacl_nodef" in true) test_skipped "I don't know how to use your setfacl command" ;; diff --git a/testsuite/acls.test b/testsuite/acls.test index 23449018..693da667 100644 --- a/testsuite/acls.test +++ b/testsuite/acls.test @@ -7,7 +7,7 @@ . $suitedir/rsync.fns -$RSYNC --version | grep "[, ] ACLs" >/dev/null || test_skipped "Rsync is configured without ACL support" +$RSYNC -VV | grep '"ACLs": true' >/dev/null || test_skipped "Rsync is configured without ACL support" makepath "$fromdir/foo" echo something >"$fromdir/file1" diff --git a/testsuite/atimes.test b/testsuite/atimes.test index 3bdb1d46..4d46eb05 100644 --- a/testsuite/atimes.test +++ b/testsuite/atimes.test @@ -4,7 +4,7 @@ . "$suitedir/rsync.fns" -$RSYNC --version | grep "[, ] atimes" >/dev/null || test_skipped "Rsync is configured without atimes support" +$RSYNC -VV | grep '"atimes": true' >/dev/null || test_skipped "Rsync is configured without atimes support" mkdir "$fromdir" diff --git a/testsuite/chown.test b/testsuite/chown.test index 5dadb836..b53413e1 100644 --- a/testsuite/chown.test +++ b/testsuite/chown.test @@ -15,7 +15,7 @@ case $0 in *fake*) - $RSYNC --version | grep "[, ] xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" + $RSYNC -VV | grep '"xattrs": true' >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" RSYNC="$RSYNC --fake-super" TLS_ARGS="$TLS_ARGS --fake-super" case "$HOST_OS" in diff --git a/testsuite/crtimes.test b/testsuite/crtimes.test index 07d9269b..456f0a5f 100644 --- a/testsuite/crtimes.test +++ b/testsuite/crtimes.test @@ -4,7 +4,7 @@ . "$suitedir/rsync.fns" -$RSYNC --version | grep "[, ] crtimes" >/dev/null || test_skipped "Rsync is configured without crtimes support" +$RSYNC -VV | grep '"crtimes": true' >/dev/null || test_skipped "Rsync is configured without crtimes support" # Setting an older time via touch sets the create time to the mtime. # Setting it to a newer time affects just the mtime. diff --git a/testsuite/daemon.test b/testsuite/daemon.test index 80d2baf6..60aa334b 100644 --- a/testsuite/daemon.test +++ b/testsuite/daemon.test @@ -81,7 +81,7 @@ drwxr-xr-x DIR ####/##/## ##:##:## foo EOT diff $diffopt "$chkfile" "$outfile" || test_fail "test 3 failed" -if $RSYNC --version | grep "[, ] atimes" >/dev/null; then +if $RSYNC -VV | grep '"atimes": true' >/dev/null; then checkdiff "$RSYNC -rU localhost::test-from/f*" \ "sed -e '$FILE_REPL' -e '$DIR_REPL' -e '$LS_REPL'" <<EOT drwxr-xr-x DIR ####/##/## ##:##:## foo diff --git a/testsuite/devices.test b/testsuite/devices.test index cd9cf3a2..ad5f936b 100644 --- a/testsuite/devices.test +++ b/testsuite/devices.test @@ -13,7 +13,7 @@ case $0 in *fake*) - $RSYNC --version | grep "[, ] xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" + $RSYNC -VV | grep '"xattrs": true' >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" RSYNC="$RSYNC --fake-super" TLS_ARGS="$TLS_ARGS --fake-super" case "$HOST_OS" in @@ -94,7 +94,7 @@ esac # TODO: Need to test whether hardlinks are possible on this OS/filesystem -$RSYNC --version | grep "[, ] hardlink-special" >/dev/null && CAN_HLINK_SPECIAL=yes || CAN_HLINK_SPECIAL=no +$RSYNC -VV | grep '"hardlink_specials": true' >/dev/null && CAN_HLINK_SPECIAL=yes || CAN_HLINK_SPECIAL=no mkdir "$fromdir" mkdir "$todir" diff --git a/testsuite/itemize.test b/testsuite/itemize.test index 7c29f696..c1c57c59 100644 --- a/testsuite/itemize.test +++ b/testsuite/itemize.test @@ -25,7 +25,7 @@ ln "$fromdir/foo/config1" "$fromdir/foo/extra" rm -f "$to2dir" # Check if rsync is set to hard-link symlinks. -if $RSYNC --version | grep "[, ] hardlink-symlinks" >/dev/null; then +if $RSYNC -VV | grep '"hardlink_symlinks": true' >/dev/null; then L=hL sym_dots="$allspace" L_sym_dots=".L$allspace" @@ -45,7 +45,7 @@ case "$RSYNC" in T=.T ;; *) - if $RSYNC --version | grep "[, ] symtimes" >/dev/null; then + if $RSYNC -VV | grep '"symtimes": true' >/dev/null; then T=.t else T=.T diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test index 455abef1..d94d5f95 100644 --- a/testsuite/xattrs.test +++ b/testsuite/xattrs.test @@ -8,7 +8,7 @@ . $suitedir/rsync.fns lnkdir="$tmpdir/lnk" -$RSYNC --version | grep "[, ] xattrs" >/dev/null || test_skipped "Rsync is configured without xattr support" +$RSYNC -VV | grep '"xattrs": true' >/dev/null || test_skipped "Rsync is configured without xattr support" case "$HOST_OS" in darwin*) diff --git a/usage.c b/usage.c index 2db64767..a5b59ad8 100644 --- a/usage.c +++ b/usage.c @@ -290,7 +290,7 @@ void print_rsync_version(enum logcode f) output_nno_list(f, "Daemon auth list", &valid_auth_checksums); if (f == FNONE) { - json_line("license", "GPL3"); + json_line("license", "GPLv3"); json_line("caveat", "rsync comes with ABSOLUTELY NO WARRANTY"); printf("\n}\n"); return; -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs