emerge-webrsync: rsync -o -g, bug #442190
authorZac Medico <zmedico@gentoo.org>
Wed, 7 Nov 2012 16:48:40 +0000 (08:48 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 7 Nov 2012 16:48:40 +0000 (08:48 -0800)
This fixes a regression since the -a option was removed in
commit e672b5ccbbbe38eda5c733fc799a20d92a8bdf75.

bin/emerge-webrsync
misc/emerge-delta-webrsync

index 09b75746c1a78f7b1f74c615b42f709908dc3ffb..e826ec44065a404448e0659ada84592c31bc763c 100755 (executable)
@@ -221,10 +221,13 @@ sync_local() {
                # Free disk space
                ${keep} || rm -f "${file}"
 
-               chown ${ownership} portage > /dev/null 2>&1 && \
+               local rsync_opts="${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS}"
+               if chown ${ownership} portage > /dev/null 2>&1; then
                        chown -R ${ownership} portage
+                       rsync_opts+=" --owner --group"
+               fi
                cd portage
-               rsync ${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS} . "${PORTDIR%%/}"
+               rsync ${rsync_opts} . "${PORTDIR%%/}"
                cd ..
 
                __vecho "Cleaning up ..."
index 9dd2a62812b6770c582261d972c472ac5cd02fb1..a782be71d52e960b8ccf2a467225eb7cdefeb535 100755 (executable)
@@ -302,11 +302,14 @@ sync_local() {
                        echo "Executed command: tar jxf $FILE"
                        exit 1
                fi
-               # Make sure user and group file ownership is appropriate
-               chown ${ownership} portage > /dev/null 2>&1 && \
+
+               local rsync_opts="${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS}"
+               if chown ${ownership} portage > /dev/null 2>&1; then
                        chown -R ${ownership} portage
+                       rsync_opts+=" --owner --group"
+               fi
                cd portage
-               rsync ${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS} . "${PORTDIR%%/}"
+               rsync ${rsync_opts} . "${PORTDIR%%/}"
                cd ..
                echo "cleaning up"
                rm -rf portage