From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6BCC61381F4 for ; Sat, 18 Aug 2012 03:07:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 025D8E093A for ; Sat, 18 Aug 2012 03:07:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DE0D7E0965 for ; Sat, 18 Aug 2012 01:28:19 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 51AF61B4022 for ; Sat, 18 Aug 2012 01:28:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 135D9E5445 for ; Sat, 18 Aug 2012 01:28:17 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1345251439.87a769bdab8e54c68260996026c87d3d7845d2e6.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: misc/ X-VCS-Repository: proj/portage X-VCS-Files: misc/emerge-delta-webrsync X-VCS-Directories: misc/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 87a769bdab8e54c68260996026c87d3d7845d2e6 X-VCS-Branch: master Date: Sat, 18 Aug 2012 01:28:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 45cfb0a5-cd21-4ad9-8d4e-ae8fa520491c X-Archives-Hash: 37b8ead89d107e9776942368063b5e67 commit: 87a769bdab8e54c68260996026c87d3d7845d2e6 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 18 00:57:19 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Aug 18 00:57:19 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87a769bd emerge-delta-webrsync: handle FEATURES=usersync --- misc/emerge-delta-webrsync | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index 2f73c90..e23316a 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -221,9 +221,24 @@ sync_local() { fi echo Syncing local tree... + + local ownership="portage:portage" + if has usersync ${FEATURES} ; then + case "${USERLAND}" in + BSD) + ownership=$(stat -f '%Su:%Sg' "${PORTDIR}") + ;; + *) + ownership=$(stat -c '%U:%G' "${PORTDIR}") + ;; + esac + fi + if type -p tarsync &> /dev/null; then echo "apparently you have tarsync installed. using it." - if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o portage -g portage -e /distfiles -e /packages -e /local; then + local chown_opts="-o ${ownership%:*} -g ${ownership#*:}" + chown ${ownership} "${PORTDIR}" > /dev/null 2>&1 || chown_opts="" + if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 ${chown_opts} -e /distfiles -e /packages -e /local; then echo "ok, tarsync failed. that's teh suck :/" exit 6 fi @@ -238,8 +253,9 @@ sync_local() { echo "Executed command: tar jxf $FILE" exit 1 fi - # Make sure user and group file ownership is root - chown -R 0:0 portage + # Make sure user and group file ownership is appropriate + chown ${ownership} portage > /dev/null 2>&1 && \ + chown -R ${ownership} portage cd portage rsync -av --progress --stats --delete --delete-after \ --exclude='/distfiles' --exclude='/packages' \