]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
shell: test -a|o is not POSIX (#250)
authorIssam Maghni <concatime@users.noreply.github.com>
Sun, 7 Nov 2021 18:23:01 +0000 (13:23 -0500)
committerGitHub <noreply@github.com>
Sun, 7 Nov 2021 18:23:01 +0000 (10:23 -0800)
Makefile.in
configure.ac
install-sh
packaging/prep-auto-dir
prepare-source
runtests.sh
testsuite/chmod-temp-dir.test
testsuite/rsync.fns

index c4c00e9649953ccfd3a0370c655c09c5fb4d48be..3c8c22405b7b5a11781df6427108a50e0743d6e6 100644 (file)
@@ -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 \
index d80194ee44d21f84bdf9911b1d2a5d0df8ba071c..fbdd17d834d20fbc418b40244e5a8972e594e157 100644 (file)
@@ -262,7 +262,7 @@ 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
            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);]])],
@@ -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"
index 956817d4bffa641018eb8c6686dfb1ce40402050..8c409fbb9df2188dd3afa91d3193a1f902ae134d 100755 (executable)
@@ -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
index 1e5a296565b3cfcec4c52d5e52ed618296316284..b67f390ab045f69fadc4839e9a55138e4bb6f66d 100755 (executable)
@@ -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
index f5b7b46ca6c43b7d535b1a0dbaaec1e9b6f2c7c6..5c56efadb9dbe63911047756cae02e592ed09a05 100755 (executable)
@@ -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
 
index 38f814d22de8a39b6aa0f76832dcab88fd1b3b9b..8c573041d7439195b3f837d2cd6a95c746c8a705 100755 (executable)
@@ -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"
index e5541e4c9c941e946eac51700631351b5316610b..22b2df81673eef5a8cff8b58e43681d235cf475b 100644 (file)
@@ -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
index 1e2b399f0cef21191b6ff297f09690578fda5fbd..2ab97b69cd54c09041a259cb8928148a7eba8ecf 100644 (file)
@@ -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`"