[csw-devel] SF.net SVN: gar:[15637] csw/mgar/pkg/rsync/branches/3.1.0dev

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sat Sep 17 15:31:10 CEST 2011


Revision: 15637
          http://gar.svn.sourceforge.net/gar/?rev=15637&view=rev
Author:   bdwalton
Date:     2011-09-17 13:31:10 +0000 (Sat, 17 Sep 2011)
Log Message:
-----------
rsync/branches/3.1.0dev: add patches and configure option changes to get xattr support for Sol9+

Modified Paths:
--------------
    csw/mgar/pkg/rsync/branches/3.1.0dev/Makefile
    csw/mgar/pkg/rsync/branches/3.1.0dev/checksums

Added Paths:
-----------
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0001-fix-PATH-handling-for-test-suite.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0002-detect-O_NOFOLLOW-support.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0003-Add-conditional-handling-of-O_NOFOLLOW-in-syscall.c.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0004-change-xattr-tool-detection-to-use-uname-s.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0005-Testsuite-Honour-PATH-when-finding-fakeroot.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0006-Testsuite-Honour-PATH-when-finding-sh.patch
    csw/mgar/pkg/rsync/branches/3.1.0dev/files/0007-Testsuite-Extend-xattr-manipulation-for-Solaris.patch

Modified: csw/mgar/pkg/rsync/branches/3.1.0dev/Makefile
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/Makefile	2011-09-17 00:10:04 UTC (rev 15636)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/Makefile	2011-09-17 13:31:10 UTC (rev 15637)
@@ -16,6 +16,13 @@
 
 MASTER_SITES = http://samba.anu.edu.au/ftp/rsync/
 DISTFILES = $(DISTNAME).tar.gz
+PATCHFILES += 0001-fix-PATH-handling-for-test-suite.patch
+PATCHFILES += 0002-detect-O_NOFOLLOW-support.patch
+PATCHFILES += 0003-Add-conditional-handling-of-O_NOFOLLOW-in-syscall.c.patch
+PATCHFILES += 0004-change-xattr-tool-detection-to-use-uname-s.patch
+PATCHFILES += 0005-Testsuite-Honour-PATH-when-finding-fakeroot.patch
+PATCHFILES += 0006-Testsuite-Honour-PATH-when-finding-sh.patch
+PATCHFILES += 0007-Testsuite-Extend-xattr-manipulation-for-Solaris.patch
 
 VENDOR_URL = http://rsync.samba.org/
 
@@ -28,6 +35,7 @@
 
 CONFIGURE_ARGS += $(DIRPATHS)
 CONFIGURE_ARGS += --with-rsyncd-conf=$(sysconfdir)/rsyncd.conf
+CONFIGURE_ARGS += --enable-xattr-support
 
 include gar/category.mk
 

Modified: csw/mgar/pkg/rsync/branches/3.1.0dev/checksums
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/checksums	2011-09-17 00:10:04 UTC (rev 15636)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/checksums	2011-09-17 13:31:10 UTC (rev 15637)
@@ -1 +1 @@
-9e30a76847396d29f92e0aa92f9611a9  rsync-3.1.0dev.tar.gz
+034b484ad7ad027a511bd9b1fb7cc8b3  rsync-3.1.0dev.tar.gz

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0001-fix-PATH-handling-for-test-suite.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0001-fix-PATH-handling-for-test-suite.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0001-fix-PATH-handling-for-test-suite.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,25 @@
+From debc0397d5608430618ab8942dbeeee999c71a85 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Thu, 15 Sep 2011 03:46:16 +0200
+Subject: [PATCH] fix PATH handling for test suite
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ runtests.sh |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/runtests.sh b/runtests.sh
+index 43732ce..8126c95 100755
+--- a/runtests.sh
++++ b/runtests.sh
+@@ -130,6 +130,7 @@ export RUNSHFLAGS
+ 
+ # for Solaris
+ [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin/:$PATH"
++export PATH
+ 
+ if [ "x$loglevel" != x ] && [ "$loglevel" -gt 8 ]; then
+     if set -x; then
+-- 
+1.7.6.1
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0002-detect-O_NOFOLLOW-support.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0002-detect-O_NOFOLLOW-support.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0002-detect-O_NOFOLLOW-support.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,26 @@
+From 50a80bb5e2c2705d5a354f4a22ce58408041d39b Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Mon, 12 Sep 2011 03:56:58 +0200
+Subject: [PATCH] detect O_NOFOLLOW support
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ configure.ac |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8962b15..1ecd66b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -579,6 +579,8 @@ if test x"$ac_cv_func_aclsort" = x"no"; then
+     AC_CHECK_LIB(sec, aclsort)
+ fi
+ 
++AC_CHECK_DECL(O_NOFOLLOW,[AC_DEFINE(FCNTL_DEFINES_O_NOFOLLOW, 1, [Define to 1 if your open() supports O_NOFOLLOW])], [], [[#include <fcntl.h>]])
++
+ dnl At the moment we don't test for a broken memcmp(), because all we
+ dnl need to do is test for equality, not comparison, and it seems that
+ dnl every platform has a memcmp that can do at least that.
+-- 
+1.7.6
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0003-Add-conditional-handling-of-O_NOFOLLOW-in-syscall.c.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0003-Add-conditional-handling-of-O_NOFOLLOW-in-syscall.c.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0003-Add-conditional-handling-of-O_NOFOLLOW-in-syscall.c.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,56 @@
+From 1cfac0638a8720d2e9351cdc52a3d5f0f1543358 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Tue, 13 Sep 2011 02:33:24 +0200
+Subject: [PATCH] Add conditional handling of O_NOFOLLOW in syscall.c
+
+To facilitate systems without O_NOFOLLOW (eg: Solaris 9), add
+conditional support for reading a symlink in do_readlink.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ syscall.c |   27 +++++++++++++++++++++++++++
+ 1 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/syscall.c b/syscall.c
+index c6c571a..224bc88 100644
+--- a/syscall.c
++++ b/syscall.c
+@@ -87,8 +87,35 @@ ssize_t do_readlink(const char *path, char *buf, size_t bufsiz)
+ {
+ 	/* For --fake-super, we read the link from the file. */
+ 	if (am_root < 0) {
++#ifndef FCNTL_DEFINES_O_NOFOLLOW
++		/* Before and After stat to detect changes during race */
++		struct stat b_st, a_st;
++		if (lstat(path, &b_st) != 0)
++			return -1;
++
++		if (!S_ISREG(b_st.st_mode))
++			return -1;
++
++		int fd = open(path, O_RDONLY);
++#else
+ 		int fd = open(path, O_RDONLY|O_NOFOLLOW);
++#endif
++
+ 		if (fd >= 0) {
++#ifndef FCNTL_DEFINES_O_NOFOLLOW
++			/* Handle the race condition...File may have been
++			   changed between lstat() and open().  Double check
++			   that device and inode are the same as the
++			   pre-flight test. */
++			if (fstat(fd, &a_st) != 0)
++				return -1;
++
++			/* If the file changed, bail out! */
++			if (a_st.st_dev != b_st.st_dev ||
++					a_st.st_ino != b_st.st_ino)
++				return -1;
++#endif
++
+ 			int len = read(fd, buf, bufsiz);
+ 			close(fd);
+ 			return len;
+-- 
+1.7.6.1
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0004-change-xattr-tool-detection-to-use-uname-s.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0004-change-xattr-tool-detection-to-use-uname-s.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0004-change-xattr-tool-detection-to-use-uname-s.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,60 @@
+From a8fde88e23a3d56e20027cd4cdb970edcb64168c Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Thu, 15 Sep 2011 04:26:00 +0200
+Subject: [PATCH] change xattr tool detection to use uname -s
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ testsuite/chown.test   |    4 ++--
+ testsuite/devices.test |    4 ++--
+ testsuite/xattrs.test  |    4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/testsuite/chown.test b/testsuite/chown.test
+index d238a8f..ee1f020 100644
+--- a/testsuite/chown.test
++++ b/testsuite/chown.test
+@@ -18,8 +18,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 "`uname -s`" in
++    Darwin)
+ 	chown() {
+ 	    own=$1
+ 	    shift
+diff --git a/testsuite/devices.test b/testsuite/devices.test
+index a85954b..fcd3eb0 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 "`uname -s`" in
++    Darwin)
+ 	mknod() {
+ 	    fn="$1"
+ 	    case "$2" in
+diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test
+index c1846df..fd2957a 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 "`uname -s`" in
++Darwin)
+     xset() {
+ 	xnam="$1"
+ 	xval="$2"
+-- 
+1.7.6.1
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0005-Testsuite-Honour-PATH-when-finding-fakeroot.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0005-Testsuite-Honour-PATH-when-finding-fakeroot.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0005-Testsuite-Honour-PATH-when-finding-fakeroot.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,60 @@
+From 5c49cdab471a79c7bf72402aa4f14ba3b04a55e3 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sat, 17 Sep 2011 15:14:23 +0200
+Subject: [PATCH] Testsuite: Honour PATH when finding fakeroot
+
+Some systems may have fakeroot, but not at /usr/bin.  Use PATH to see
+if the tool is available.  This will allow using fakeroot on a
+Solaris/OpenCSW stack where fakeroot is at /opt/csw/bin/fakeroot.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ testsuite/chown.test   |    6 ++++--
+ testsuite/devices.test |    6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/testsuite/chown.test b/testsuite/chown.test
+index ee1f020..5631747 100644
+--- a/testsuite/chown.test
++++ b/testsuite/chown.test
+@@ -37,12 +37,14 @@ case $0 in
+     ;;
+ *)
+     RSYNC="$RSYNC --super"
++    # make fakeroot detection take path into account
++    fr="`which fakeroot 2>/dev/null`"
+     case `get_testuid` in
+     '') ;; # If "id" failed, try to continue...
+     0)  ;;
+-    *)  if [ -f /usr/bin/fakeroot ]; then
++    *)  if [ -n "${fr}" ]; then
+ 	    echo "Let's try re-running the script under fakeroot..."
+-	    exec /usr/bin/fakeroot /bin/sh "$0"
++	    exec "${fr}" /bin/sh "$0"
+ 	fi
+ 	;;
+     esac
+diff --git a/testsuite/devices.test b/testsuite/devices.test
+index fcd3eb0..30bc1c4 100644
+--- a/testsuite/devices.test
++++ b/testsuite/devices.test
+@@ -51,12 +51,14 @@ case $0 in
+     esac
+     ;;
+ *)
++    # make fakeroot detection take path into account
++    fr="`which fakeroot 2>/dev/null`"
+     case `get_testuid` in
+     '') ;; # If "id" failed, try to continue...
+     0)  ;;
+-    *)  if [ -f /usr/bin/fakeroot ]; then
++    *)  if [ -n "${fr}" ]; then
+ 	    echo "Let's try re-running the script under fakeroot..."
+-	    exec /usr/bin/fakeroot /bin/sh $RUNSHFLAGS "$0"
++	    exec "${fr}" /bin/sh $RUNSHFLAGS "$0"
+ 	fi
+ 	test_skipped "Rsync needs root/fakeroot for device tests"
+ 	;;
+-- 
+1.7.6.1
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0006-Testsuite-Honour-PATH-when-finding-sh.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0006-Testsuite-Honour-PATH-when-finding-sh.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0006-Testsuite-Honour-PATH-when-finding-sh.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,58 @@
+From 4c649bc6397314ec78cae47e206d477b16b0bf00 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sat, 17 Sep 2011 15:17:39 +0200
+Subject: [PATCH] Testsuite: Honour PATH when finding sh
+
+This patch removes the hard coding of /bin/sh so that on Solaris where
+the test suite is run with /usr/xpg4/bin leading the PATH, the POSIX
+sh will be used instead of the default system shell.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ testsuite/chown.test   |    4 +++-
+ testsuite/devices.test |    4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/testsuite/chown.test b/testsuite/chown.test
+index 5631747..7038550 100644
+--- a/testsuite/chown.test
++++ b/testsuite/chown.test
+@@ -39,12 +39,14 @@ case $0 in
+     RSYNC="$RSYNC --super"
+     # make fakeroot detection take path into account
+     fr="`which fakeroot 2>/dev/null`"
++    # for solaris so /usr/xpg4/bin is honoured in the path
++    shell=`which sh`
+     case `get_testuid` in
+     '') ;; # If "id" failed, try to continue...
+     0)  ;;
+     *)  if [ -n "${fr}" ]; then
+ 	    echo "Let's try re-running the script under fakeroot..."
+-	    exec "${fr}" /bin/sh "$0"
++	    exec "${fr}" "${shell}" "$0"
+ 	fi
+ 	;;
+     esac
+diff --git a/testsuite/devices.test b/testsuite/devices.test
+index 30bc1c4..14ed317 100644
+--- a/testsuite/devices.test
++++ b/testsuite/devices.test
+@@ -53,12 +53,14 @@ case $0 in
+ *)
+     # make fakeroot detection take path into account
+     fr="`which fakeroot 2>/dev/null`"
++    # for solaris so /usr/xpg4/bin is honoured in the path
++    shell=`which sh`
+     case `get_testuid` in
+     '') ;; # If "id" failed, try to continue...
+     0)  ;;
+     *)  if [ -n "${fr}" ]; then
+ 	    echo "Let's try re-running the script under fakeroot..."
+-	    exec "${fr}" /bin/sh $RUNSHFLAGS "$0"
++	    exec "${fr}" "${shell}" $RUNSHFLAGS "$0"
+ 	fi
+ 	test_skipped "Rsync needs root/fakeroot for device tests"
+ 	;;
+-- 
+1.7.6.1
+

Added: csw/mgar/pkg/rsync/branches/3.1.0dev/files/0007-Testsuite-Extend-xattr-manipulation-for-Solaris.patch
===================================================================
--- csw/mgar/pkg/rsync/branches/3.1.0dev/files/0007-Testsuite-Extend-xattr-manipulation-for-Solaris.patch	                        (rev 0)
+++ csw/mgar/pkg/rsync/branches/3.1.0dev/files/0007-Testsuite-Extend-xattr-manipulation-for-Solaris.patch	2011-09-17 13:31:10 UTC (rev 15637)
@@ -0,0 +1,100 @@
+From e039547532622de2de3d742c3ded4189019e94e9 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sat, 17 Sep 2011 15:23:11 +0200
+Subject: [PATCH] Testsuite: Extend xattr manipulation for Solaris
+
+Add chown(), mknod(), xls() and xset() shell functions for Solaris so
+that we can capably test the xattr support in the rsync binary.  The
+functions all use runat to manipulate the extended attribute space.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ testsuite/chown.test   |   11 +++++++++++
+ testsuite/devices.test |   16 ++++++++++++++++
+ testsuite/xattrs.test  |   21 +++++++++++++++++++++
+ 3 files changed, 48 insertions(+), 0 deletions(-)
+
+diff --git a/testsuite/chown.test b/testsuite/chown.test
+index 7038550..2fa599d 100644
+--- a/testsuite/chown.test
++++ b/testsuite/chown.test
+@@ -26,6 +26,17 @@ case $0 in
+ 	    xattr -s 'rsync.%stat' "100644 0,0 $own" "${@}"
+ 	}
+ 	;;
++    SunOS)
++	chown() {
++	    own=$1
++	    shift
++	    for f in "${@}"; do
++		runat "${f}" /usr/xpg4/bin/sh <<EOF
++echo "100644 0,0 $own" > rsync.%stat
++EOF
++	    done
++	}
++	;;
+     *)
+ 	chown() {
+ 	    own=$1
+diff --git a/testsuite/devices.test b/testsuite/devices.test
+index 14ed317..e6b74cd 100644
+--- a/testsuite/devices.test
++++ b/testsuite/devices.test
+@@ -34,6 +34,22 @@ case $0 in
+ 	    xattr -s 'rsync.%stat' "$mode $maj,$min 0:0" "$fn"
+ 	}
+ 	;;
++    SunOS)
++	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}" /usr/xpg4/bin/sh <<EOF
++echo "$mode $maj,$min 0:0" > rsync.%stat
++EOF
++	}
++	;;
+     *)
+ 	mknod() {
+ 	    fn="$1"
+diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test
+index fd2957a..42492a7 100644
+--- a/testsuite/xattrs.test
++++ b/testsuite/xattrs.test
+@@ -24,6 +24,27 @@ Darwin)
+     RSYNC_PREFIX='rsync'
+     RUSR='rsync.nonuser'
+     ;;
++SunOS)
++    xset() {
++       xnam="$1"
++       xval="$2"
++       shift 2
++       for f in "${@}"; do
++           runat "${f}" /usr/xpg4/bin/sh <<EOF
++echo "${xval}" > "${xnam}"
++EOF
++       done
++    }
++    xls() {
++       for f in "${@}"; do
++           runat "${f}" /usr/xpg4/bin/sh <<EOF
++for x in *; do echo "\$x=\`cat \$x\`"; done
++EOF
++       done
++    }
++    RSYNC_PREFIX='rsync'
++    RUSR='rsync.nonuser'
++    ;;
+ *)
+     xset() {
+ 	xnam="$1"
+-- 
+1.7.6.1
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list