The branch, master has been updated via 1f0e62f1 Improve a couple support scripts: via 7d830ff5 improved cross compilation detection (#252) via 8f383e89 shell: test -a|o is not POSIX (#250) from ca538965 Add closing backticks that Itzoke pointed out.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 1f0e62f139565f39020e1f76700828b415b01bcf Author: Wayne Davison <wa...@opencoder.net> Date: Sat Nov 13 09:30:08 2021 -0800 Improve a couple support scripts: - rsync-no-vanished now avoids joining stdout & stderr, avoids affecting a non-client run, and gets the rsync status code correctly. - rsync-slash-strip now avoids affecting a non-client run. commit 7d830ff52ff7b01f528f39aa27b1ab36ea8c1356 Author: Andrew Aladjev <aladjev.and...@gmail.com> Date: Sun Nov 7 22:45:49 2021 +0300 improved cross compilation detection (#252) commit 8f383e8987482ce8194f40d0486dac6f95d83033 Author: Issam Maghni <concat...@users.noreply.github.com> Date: Sun Nov 7 13:23:01 2021 -0500 shell: test -a|o is not POSIX (#250) ----------------------------------------------------------------------- Summary of changes: Makefile.in | 2 +- configure.ac | 10 +++++----- install-sh | 2 +- packaging/prep-auto-dir | 2 +- prepare-source | 2 +- runtests.sh | 8 ++++---- support/rsync-no-vanished | 13 +++++++++++-- support/rsync-slash-strip | 9 ++++++++- testsuite/chmod-temp-dir.test | 2 +- testsuite/rsync.fns | 2 +- 10 files changed, 34 insertions(+), 18 deletions(-) Changeset truncated at 500 lines: diff --git a/Makefile.in b/Makefile.in index c4c00e96..3c8c2240 100644 --- a/Makefile.in +++ b/Makefile.in @@ -200,7 +200,7 @@ configure.sh config.h.in: configure.ac aclocal.m4 else \ echo "config.h.in has CHANGED."; \ fi - @if test -f configure.sh.old -o -f config.h.in.old; then \ + @if test -f configure.sh.old || test -f config.h.in.old; then \ if test "$(MAKECMDGOALS)" = reconfigure; then \ echo 'Continuing with "make reconfigure".'; \ else \ diff --git a/configure.ac b/configure.ac index d80194ee..9e7338cf 100644 --- a/configure.ac +++ b/configure.ac @@ -262,9 +262,9 @@ fi if test x"$enable_simd" != x"no"; then # For x86-64 SIMD, g++ >=5 or clang++ >=7 is required - if test x"$host_cpu" = x"x86_64" -o x"$host_cpu" = x"amd64"; then + if test x"$host_cpu" = x"x86_64" || test x"$host_cpu" = x"amd64"; then AC_LANG(C++) - if test x"$host_cpu" = x"$build_cpu"; then + if test x"$host" = x"$build"; then AC_RUN_IFELSE([AC_LANG_PROGRAM([SIMD_X86_64_TEST],[[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])], [CXX_OK=yes],[CXX_OK=no]) else @@ -326,7 +326,7 @@ if test x"$enable_asm" = x""; then fi if test x"$enable_asm" != x"no"; then - if test x"$host_cpu" = x"x86_64" -o x"$host_cpu" = x"amd64"; then + if test x"$host_cpu" = x"x86_64" || test x"$host_cpu" = x"amd64"; then ASM="$host_cpu" elif test x"$enable_asm" = x"yes"; then AC_MSG_RESULT(unavailable) @@ -712,7 +712,7 @@ yes #endif], rsync_cv_HAVE_GETADDR_DEFINES=yes, rsync_cv_HAVE_GETADDR_DEFINES=no)]) -AS_IF([test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes" -a x"$ac_cv_type_struct_addrinfo" = x"yes"],[ +AS_IF([test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes" && test x"$ac_cv_type_struct_addrinfo" = x"yes"],[ # Tru64 UNIX has getaddrinfo() but has it renamed in libc as # something else so we must include <netdb.h> to get the # redefinition. @@ -1384,7 +1384,7 @@ else esac fi -if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"$enable_iconv" = x"no"; then +if test x"$enable_acl_support" = x"no" || test x"$enable_xattr_support" = x"no" || test x"$enable_iconv" = x"no"; then AC_MSG_CHECKING([whether $CC supports -Wno-unused-parameter]) OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-parameter" diff --git a/install-sh b/install-sh index 956817d4..8c409fbb 100755 --- a/install-sh +++ b/install-sh @@ -115,7 +115,7 @@ else # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. - if [ -f $src -o -d $src ] + if [ -f $src ] || [ -d $src ] then true else diff --git a/packaging/prep-auto-dir b/packaging/prep-auto-dir index 1e5a2965..b67f390a 100755 --- a/packaging/prep-auto-dir +++ b/packaging/prep-auto-dir @@ -13,7 +13,7 @@ # run "make distclean" before creating the auto-build-save dir. auto_top='auto-build-save' -if test -d $auto_top -a -d .git; then +if test -d $auto_top && test -d .git; then desired_branch=`git rev-parse --abbrev-ref HEAD | tr / %` if test "$desired_branch" = HEAD; then echo "ERROR: switch to the right build dir manually when in detached HEAD mode." 1>&2 diff --git a/prepare-source b/prepare-source index f5b7b46c..5c56efad 100755 --- a/prepare-source +++ b/prepare-source @@ -32,7 +32,7 @@ if test "$dir" != '.'; then fi done for fn in configure.sh config.h.in aclocal.m4; do - test ! -f $fn -a -f "$dir/$fn" && cp -p "$dir/$fn" $fn + test ! -f $fn && test -f "$dir/$fn" && cp -p "$dir/$fn" $fn done fi diff --git a/runtests.sh b/runtests.sh index 38f814d2..8c573041 100755 --- a/runtests.sh +++ b/runtests.sh @@ -155,7 +155,7 @@ if test x"$TOOLDIR" = x; then TOOLDIR=`pwd` fi srcdir=`dirname $0` -if test x"$srcdir" = x -o x"$srcdir" = x.; then +if test x"$srcdir" = x || test x"$srcdir" = x.; then srcdir="$TOOLDIR" fi if test x"$rsync_bin" = x; then @@ -288,7 +288,7 @@ for testscript in $suitedir/$whichtests; do result=$? set -e - if [ "x$always_log" = xyes -o \( $result != 0 -a $result != 77 -a $result != 78 \) ] + if [ "x$always_log" = xyes ] || ( [ $result != 0 ] && [ $result != 77 ] && [ $result != 78 ] ) then echo "----- $testbase log follows" cat "$scratchdir/test.log" @@ -336,7 +336,7 @@ echo " $passed passed" [ "$failed" -gt 0 ] && echo " $failed failed" [ "$skipped" -gt 0 ] && echo " $skipped skipped" [ "$missing" -gt 0 ] && echo " $missing missing" -if [ "$full_run" = yes -a "$expect_skipped" != IGNORE ]; then +if [ "$full_run" = yes ] && [ "$expect_skipped" != IGNORE ]; then skipped_list=`echo "$skipped_list" | sed 's/^,//'` echo "----- skipped results:" echo " expected: $expect_skipped" @@ -353,7 +353,7 @@ echo '------------------------------------------------------------' # because -e is set. result=`expr $failed + $missing || true` -if [ "$result" = 0 -a "$skipped_list" != "$expect_skipped" ]; then +if [ "$result" = 0 ] && [ "$skipped_list" != "$expect_skipped" ]; then result=1 fi echo "overall result is $result" diff --git a/support/rsync-no-vanished b/support/rsync-no-vanished index 0f0bb22f..b31a5d21 100755 --- a/support/rsync-no-vanished +++ b/support/rsync-no-vanished @@ -1,12 +1,21 @@ #!/usr/bin/env bash +REAL_RSYNC=/usr/bin/rsync IGNOREEXIT=24 IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)' +# If someone installs this as "rsync", make sure we don't affect a server run. +for arg in "${@}"; do + if [[ "$arg" == --server ]]; then + exec $REAL_RSYNC "${@}" + exit $? # Not reached + fi +done + set -o pipefail -rsync "${@}" 2>&1 | (grep -E -v "$IGNOREOUT" || true) -ret=$? +# This filters stderr without merging it with stdout: +{ $REAL_RSYNC "${@}" 2>&1 1>&3 3>&- | grep -E -v "$IGNOREOUT"; ret=${PIPESTATUS[0]}; } 3>&1 1>&2 if [[ $ret == $IGNOREEXIT ]]; then ret=0 diff --git a/support/rsync-slash-strip b/support/rsync-slash-strip index 2869e45c..b57e61c5 100755 --- a/support/rsync-slash-strip +++ b/support/rsync-slash-strip @@ -6,12 +6,19 @@ # # To use this, name it something like "rs", put it somewhere in your path, and # then use "rs" in place of "rsync" when you are typing your copy commands. + +REAL_RSYNC=/usr/bin/rsync + args=() for arg in "${@}"; do + if [[ "$arg" == --server ]]; then + exec $REAL_RSYNC "${@}" + exit $? # Not reached + fi if [[ "$arg" == / ]]; then args=("${args[@]}" /) else args=("${args[@]}" "${arg%/}") fi done -exec /usr/bin/rsync "${args[@]}" +exec $REAL_RSYNC "${args[@]}" diff --git a/testsuite/chmod-temp-dir.test b/testsuite/chmod-temp-dir.test index e5541e4c..22b2df81 100644 --- a/testsuite/chmod-temp-dir.test +++ b/testsuite/chmod-temp-dir.test @@ -17,7 +17,7 @@ sdev=`$TOOLDIR/getfsdev $scratchdir` tdev=$sdev for tmpdir2 in "${RSYNC_TEST_TMP:-/override-tmp-not-specified}" /run/shm /var/tmp /tmp; do - [ -d "$tmpdir2" -a -w "$tmpdir2" ] || continue + [ -d "$tmpdir2" ] && [ -w "$tmpdir2" ] || continue tdev=`$TOOLDIR/getfsdev "$tmpdir2"` [ x$sdev != x$tdev ] && break done diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index 1e2b399f..2ab97b69 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -65,7 +65,7 @@ set_cp_destdir() { # even if the copy rounded microsecond times on the destination file. cp_touch() { cp_p "${@}" - if test $# -gt 2 -o -d "$2"; then + if test $# -gt 2 || test -d "$2"; then set_cp_destdir "${@}" # sets destdir var while test $# -gt 1; do destname="$destdir/`basename $1`" -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs