summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-30 09:10:18 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-30 09:10:18 +0000
commit224136f2ee226bc2122b83476208d0c20078aaf2 (patch)
treedc75dcd771abf8fa24920c89126736523102eb3d
parent501eaed99af41815e366a782b840eb868685a990 (diff)
downloadportage-224136f2ee226bc2122b83476208d0c20078aaf2.tar.gz
portage-224136f2ee226bc2122b83476208d0c20078aaf2.tar.bz2
portage-224136f2ee226bc2122b83476208d0c20078aaf2.zip
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
-rwxr-xr-xbin/emerge-webrsync5
1 files changed, 4 insertions, 1 deletions
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