From 2f972b8cd7fdc75f952e2ab51a94bfe808fc9e8b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 17 Mar 2006 22:57:26 +0000 Subject: [PATCH] Merge emerge-webrsync uid and gid fixes from the prefix branch. svn path=/main/trunk/; revision=2923 --- bin/emerge-webrsync | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index ec4e59231..0e6867341 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -17,7 +17,8 @@ PORTDIR="$(/usr/lib/portage/bin/portageq portdir)" FETCHCOMMAND="$(/usr/lib/portage/bin/portageq envvar FETCHCOMMAND)" USERLAND="$(/usr/lib/portage/bin/portageq envvar USERLAND)" DISTDIR="$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)/emerge-webrsync" - +PORTAGE_INST_UID="$(/usr/lib/portage/bin/portageq envvar PORTAGE_INST_UID)" +PORTAGE_INST_GID="$(/usr/lib/portage/bin/portageq envvar PORTAGE_INST_GID)" if [ ! -d $DISTDIR ] ; then mkdir -p $DISTDIR fi @@ -50,7 +51,7 @@ fi sync_local() { echo Syncing local tree... if type -p tarsync &> /dev/null; then - if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o root -g root -e /distfiles -e /packages -e /local; then + if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o ${PORTAGE_INST_UID} -g ${PORTAGE_INST_GID} -e /distfiles -e /packages -e /local; then echo "tarsync failed; tarball is corrupt?" exit 1; fi @@ -62,8 +63,8 @@ sync_local() { exit 1 fi rm -f $FILE - # Make sure user and group file ownership is root - chown -R 0:0 portage + # Make sure user and group file ownership is ${PORTAGE_INST_UID}:${PORTAGE_INST_GID} + chown -R ${PORTAGE_INST_UID}:${PORTAGE_INST_GID} portage cd portage rsync -av --progress --stats --delete --delete-after \ --exclude='/distfiles' --exclude='/packages' \ -- 2.26.2