public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: misc/
Date: Sat, 18 Aug 2012 01:28:17 +0000 (UTC)	[thread overview]
Message-ID: <1345251439.87a769bdab8e54c68260996026c87d3d7845d2e6.zmedico@gentoo> (raw)

commit:     87a769bdab8e54c68260996026c87d3d7845d2e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 18 00:57:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> 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' \


             reply	other threads:[~2012-08-18  3:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18  1:28 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-29  1:22 [gentoo-commits] proj/portage:master commit in: misc/ Zac Medico
2023-11-11  7:24 Sam James
2023-08-19 15:42 Sam James
2023-08-19 15:03 Sam James
2023-08-19 15:03 Sam James
2023-08-19 13:35 Sam James
2019-12-30 21:36 Zac Medico
2019-12-09  9:30 Zac Medico
2018-07-28  6:20 Zac Medico
2018-07-28  6:12 Zac Medico
2018-02-01  6:18 Zac Medico
2015-11-06  5:31 Zac Medico
2014-10-19 17:19 Zac Medico
2013-07-10 20:16 Zac Medico
2013-06-22  6:14 Zac Medico
2013-06-22  5:54 Zac Medico
2013-01-28 21:45 Zac Medico
2012-09-14  7:26 Zac Medico
2012-08-19  5:44 Zac Medico
2012-08-19  5:21 Zac Medico
2012-08-18 22:51 Zac Medico
2012-08-18 20:51 Zac Medico
2012-08-18 20:32 Zac Medico
2012-08-18  1:45 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  1:28 Zac Medico
2012-08-18  0:09 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345251439.87a769bdab8e54c68260996026c87d3d7845d2e6.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox