[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Tue Sep 20 14:29:00 MDT 2011


The branch, master has been updated
       via  0c7fdf7 Add solaris xattr support to the tests. Change the xattr case statements to use $HOST_OS. (Slightly tweaked version of a Ben Walton patch.)
       via  439d5d8 Better fakeroot support helps Solaris.
      from  de21910 Change stat order for better ELOOP determination.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0c7fdf705ec0ef4393d4af3f87de5f13956ece45
Author: Wayne Davison <wayned at samba.org>
Date:   Tue Sep 20 13:19:39 2011 -0700

    Add solaris xattr support to the tests.
    Change the xattr case statements to use $HOST_OS.
    (Slightly tweaked version of a Ben Walton patch.)

commit 439d5d89295a27ba57a11b17633601d8c5d7f8e6
Author: Wayne Davison <wayned at samba.org>
Date:   Tue Sep 20 13:10:02 2011 -0700

    Better fakeroot support helps Solaris.

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

Summary of changes:
 configure.ac           |    6 +++++-
 shconfig.in            |    5 ++++-
 testsuite/chown.test   |   19 +++++++++++++++----
 testsuite/devices.test |   24 ++++++++++++++++++++----
 testsuite/xattrs.test  |   25 +++++++++++++++++++++++--
 5 files changed, 67 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/configure.ac b/configure.ac
index 8962b15..58aeea0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,6 +134,10 @@ else
     MAKE_MAN=man-copy
 fi
 
+# Some programs on solaris are only found in /usr/xpg4/bin (or work better than others versions).
+AC_PATH_PROG(SHELL_PATH, sh, /bin/sh, [/usr/xpg4/bin$PATH_SEPARATOR$PATH])
+AC_PATH_PROG(FAKEROOT_PATH, fakeroot, /usr/bin/fakeroot, [/usr/xpg4/bin$PATH_SEPARATOR$PATH])
+
 AC_ARG_WITH(nobody-group,
     AC_HELP_STRING([--with-nobody-group=GROUP],
 		   [set the default unprivileged group (default nobody or nogroup)]),
@@ -942,7 +946,7 @@ else
 	AC_DEFINE(HAVE_UNIXWARE_ACLS, 1, [true if you have UnixWare ACLs])
 	AC_DEFINE(SUPPORT_ACLS, 1, [Define to 1 to add support for ACLs])
 	;;
-    *solaris*|*cygwin*)
+    solaris*|*cygwin*)
 	AC_MSG_RESULT(Using solaris ACLs)
 	AC_DEFINE(HAVE_SOLARIS_ACLS, 1, [true if you have solaris ACLs])
 	AC_DEFINE(SUPPORT_ACLS, 1)
diff --git a/shconfig.in b/shconfig.in
index 9e5dd55..5d1fdc5 100755
--- a/shconfig.in
+++ b/shconfig.in
@@ -8,5 +8,8 @@
 ECHO_T="@ECHO_T@"
 ECHO_N="@ECHO_N@"
 ECHO_C="@ECHO_C@"
+HOST_OS="@host_os@"
+SHELL_PATH="@SHELL_PATH@"
+FAKEROOT_PATH="@FAKEROOT_PATH@"
 
-export ECHO_T ECHO_N ECHO_C
+export ECHO_T ECHO_N ECHO_C HOST_OS SHELL_PATH FAKEROOT_PATH
diff --git a/testsuite/chown.test b/testsuite/chown.test
index d238a8f..30a3a94 100644
--- a/testsuite/chown.test
+++ b/testsuite/chown.test
@@ -18,14 +18,25 @@ case $0 in
     $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests"
     RSYNC="$RSYNC --fake-super"
     TLS_ARGS="$TLS_ARGS --fake-super"
-    case "`xattr 2>&1 || true`" in
-    *--list:*)
+    case "$HOST_OS" in
+    darwin*)
 	chown() {
 	    own=$1
 	    shift
 	    xattr -s 'rsync.%stat' "100644 0,0 $own" "${@}"
 	}
 	;;
+    solaris*)
+	chown() {
+	    own=$1
+	    shift
+	    for fn in "${@}"; do
+		runat "$fn" "$SHELL_PATH" <<EOF
+echo "100644 0,0 $own" > rsync.%stat
+EOF
+	    done
+	}
+	;;
     *)
 	chown() {
 	    own=$1
@@ -40,9 +51,9 @@ case $0 in
     case `get_testuid` in
     '') ;; # If "id" failed, try to continue...
     0)  ;;
-    *)  if [ -f /usr/bin/fakeroot ]; then
+    *)  if [ -e "$FAKEROOT_PATH" ]; then
 	    echo "Let's try re-running the script under fakeroot..."
-	    exec /usr/bin/fakeroot /bin/sh "$0"
+	    exec "$FAKEROOT_PATH" "$SHELL_PATH" "$0"
 	fi
 	;;
     esac
diff --git a/testsuite/devices.test b/testsuite/devices.test
index a85954b..a924513 100644
--- a/testsuite/devices.test
+++ b/testsuite/devices.test
@@ -19,8 +19,8 @@ case $0 in
     $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests"
     RSYNC="$RSYNC --fake-super"
     TLS_ARGS="$TLS_ARGS --fake-super"
-    case "`xattr 2>&1 || true`" in
-    *--list:*)
+    case "$HOST_OS" in
+    darwin*)
 	mknod() {
 	    fn="$1"
 	    case "$2" in
@@ -34,6 +34,22 @@ case $0 in
 	    xattr -s 'rsync.%stat' "$mode $maj,$min 0:0" "$fn"
 	}
 	;;
+    solaris*)
+	mknod() {
+	    fn="$1"
+	    case "$2" in
+	    p) mode=10644 ;;
+	    c) mode=20644 ;;
+	    b) mode=60644 ;;
+	    esac
+	    maj="${3:-0}"
+	    min="${4:-0}"
+	    touch "$fn"
+	    runat "$fn" "$SHELL_PATH" <<EOF
+echo "$mode $maj,$min 0:0" > rsync.%stat
+EOF
+	}
+	;;
     *)
 	mknod() {
 	    fn="$1"
@@ -54,9 +70,9 @@ case $0 in
     case `get_testuid` in
     '') ;; # If "id" failed, try to continue...
     0)  ;;
-    *)  if [ -f /usr/bin/fakeroot ]; then
+    *)  if [ -e "$FAKEROOT_PATH" ]; then
 	    echo "Let's try re-running the script under fakeroot..."
-	    exec /usr/bin/fakeroot /bin/sh $RUNSHFLAGS "$0"
+	    exec "$FAKEROOT_PATH" "$SHELL_PATH" $RUNSHFLAGS "$0"
 	fi
 	test_skipped "Rsync needs root/fakeroot for device tests"
 	;;
diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test
index c1846df..06afcba 100644
--- a/testsuite/xattrs.test
+++ b/testsuite/xattrs.test
@@ -10,8 +10,8 @@ lnkdir="$tmpdir/lnk"
 
 $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync is configured without xattr support"
 
-case "`xattr 2>&1 || true`" in
-*--list:*)
+case "$HOST_OS" in
+darwin*)
     xset() {
 	xnam="$1"
 	xval="$2"
@@ -24,6 +24,27 @@ case "`xattr 2>&1 || true`" in
     RSYNC_PREFIX='rsync'
     RUSR='rsync.nonuser'
     ;;
+solaris*)
+    xset() {
+	xnam="$1"
+	xval="$2"
+	shift 2
+	for fn in "${@}"; do
+	    runat "$fn" "$SHELL_PATH" <<EOF
+echo "${xval}" > "${xnam}"
+EOF
+	done
+    }
+    xls() {
+	for fn in "${@}"; do
+	    runat "$fn" "$SHELL_PATH" <<EOF
+for x in *; do echo "\$x=\`cat \$x\`"; done
+EOF
+       done
+    }
+    RSYNC_PREFIX='rsync'
+    RUSR='rsync.nonuser'
+    ;;
 *)
     xset() {
 	xnam="$1"


-- 
The rsync repository.


More information about the rsync-cvs mailing list