From: Martin Pool Date: Tue, 26 Mar 2002 01:25:47 +0000 (+0000) Subject: Jos points out that test -L is still broken on Solaris. Now we try up X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/d1239eae921d013ffeb118b1a768308e28bd9f11 Jos points out that test -L is still broken on Solaris. Now we try up front to detect a command that will work properly, and use that consistently. Also, in test report, show setting of $preserve_scratch. Reset version. --- diff --git a/NEWS b/NEWS index 1f2476d6..6166bf79 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -rsync release candidate 2.5.5rc1 (26 March 2002) +rsync changes since last release ENHANCEMENTS: @@ -16,7 +16,7 @@ rsync release candidate 2.5.5rc1 (26 March 2002) slots) would cause rsync to kill all processes owned by the current user. Yes, really! (Paul Haas, Martin Pool) - * Fix test suite on Solaris. (Jos Backus) + * Fix test suite on Solaris. (Jos Backus, Martin Pool) * Fix minor memory leak in socket code. (Dave Dykstra, Martin Pool.) diff --git a/configure.in b/configure.in index 45cb3da3..cf9ab4bb 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CONFIG_SRCDIR([byteorder.h]) AC_CONFIG_HEADER(config.h) AC_PREREQ(2.52) -RSYNC_VERSION=2.5.5rc1 +RSYNC_VERSION=2.5.5cvs AC_SUBST(RSYNC_VERSION) AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION]) diff --git a/runtests.sh b/runtests.sh index 31c49369..d2865ae3 100755 --- a/runtests.sh +++ b/runtests.sh @@ -147,6 +147,15 @@ testuser=`whoami || echo UNKNOWN` echo " testuser=$testuser" echo " os=`uname -a`" +# It must be "yes", not just nonnull +if test "x$preserve_scratch" = xyes +then + echo " preserve_scratch=yes" +else + echo " preserve_scratch=no" +fi + + if test ! -f $rsync_bin then echo "rsync_bin $rsync_bin is not a file" >&2 diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index e7f753a9..1bb23f97 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -260,9 +260,35 @@ test_xfail() { exit 78 } +# Determine what shell command will appropriately test for links. +ln -s foo "$scratchdir/testlink" +for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test +do + for switch in -h -L + do + if $cmd $switch "$scratchdir/testlink" 2>/dev/null + then + # how nice + TEST_SYMLINK_CMD="$cmd $switch" + # i wonder if break 2 is portable? + break 2 + fi + done +done + + +if [ "x$TEST_SYMLINK_CMD" = 'x' ] +then + test_fail "Couldn't determine how to test for symlinks" +else + echo "Testing for symlinks using '$TEST_SYMLINK_CMD'" +fi + + # Test whether something is a link, allowing for shell peculiarities is_a_link() { - test -L "$1" || test -h "$1" || /usr/bin/test -L "$1" || /usr/bin/test -h "$1" + # note the variable contains the first option and therefore is not quoted + $TEST_SYMLINK_CMD "$1" }