From 224136f2ee226bc2122b83476208d0c20078aaf2 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 30 May 2006 09:10:18 +0000 Subject: [PATCH] Use python to lookup the user and group corresponding to PORTAGE_INST_UID and PORTAGE_INST_GID since tarsync doesn't support numeric arguments for the user and group. See bug #134885. svn path=/main/trunk/; revision=3442 --- bin/emerge-webrsync | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 636b036e8..44e0dba8f 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -53,7 +53,10 @@ fi sync_local() { echo Syncing local tree... if type -p tarsync &> /dev/null; then - if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} -e /distfiles -e /packages -e /local; then + # tarsync doesn't take numeric uid/gid so we need to convert them. + local inst_user="$(python -c "import pwd; print pwd.getpwuid(int('${PORTAGE_INST_UID:-0}'))[0]")" + local inst_group="$(python -c "import grp; print grp.getgrgid(int('${PORTAGE_INST_GID:-0}'))[0]")" + if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o ${inst_user} -g ${inst_group} -e /distfiles -e /packages -e /local; then echo "tarsync failed; tarball is corrupt?" exit 1; fi -- 2.26.2