diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-18 20:29:55 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-18 20:29:55 +0000 |
commit | b8a4f9798f2fca741f0eef3a029f1fa09bb5823c (patch) | |
tree | e61db15bcd164c80d5960528f9683f3f4a41110c | |
parent | f1567a5e44d32b79838330d5b7e5350f609571a1 (diff) | |
download | portage-b8a4f9798f2fca741f0eef3a029f1fa09bb5823c.tar.gz portage-b8a4f9798f2fca741f0eef3a029f1fa09bb5823c.tar.bz2 portage-b8a4f9798f2fca741f0eef3a029f1fa09bb5823c.zip |
Make PORTAGE_INST_UID and PORTAGE_INST_GID default to 0 in case of environment problems.
svn path=/main/trunk/; revision=2942
-rwxr-xr-x | bin/dobin | 2 | ||||
-rwxr-xr-x | bin/dosbin | 2 | ||||
-rwxr-xr-x | bin/emerge-webrsync | 4 | ||||
-rw-r--r-- | bin/misc-functions.sh | 8 |
4 files changed, 8 insertions, 8 deletions
@@ -16,7 +16,7 @@ ret=0 for x in "$@" ; do if [[ -e ${x} ]] ; then - install -m0755 -o ${PORTAGE_INST_UID} -g ${PORTAGE_INST_GID} "${x}" "${D}${DESTTREE}/bin" + install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin" else echo "!!! ${0##*/}: ${x} does not exist" 1>&2 false diff --git a/bin/dosbin b/bin/dosbin index 9cae684a8..30aa7893c 100755 --- a/bin/dosbin +++ b/bin/dosbin @@ -16,7 +16,7 @@ ret=0 for x in "$@" ; do if [[ -e ${x} ]] ; then - install -m0755 -o ${PORTAGE_INST_UID} -g ${PORTAGE_INST_GID} "${x}" "${D}${DESTTREE}/sbin" + install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/sbin" else echo "!!! ${0##*/}: ${x} does not exist" 1>&2 false diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index f92c9262c..2bce994a9 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -51,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 ${PORTAGE_INST_UID} -g ${PORTAGE_INST_GID} -e /distfiles -e /packages -e /local; 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 echo "tarsync failed; tarball is corrupt?" exit 1; fi @@ -64,7 +64,7 @@ sync_local() { fi rm -f $FILE # Make sure user and group file ownership is ${PORTAGE_INST_UID}:${PORTAGE_INST_GID} - chown -R ${PORTAGE_INST_UID}:${PORTAGE_INST_GID} portage + chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} portage cd portage rsync -av --progress --stats --delete --delete-after \ --exclude='/distfiles' --exclude='/packages' \ diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index dff882232..e5751e136 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -220,14 +220,14 @@ install_qa_check() { find "${D}/" -user portage | while read file; do count=$(( $count + 1 )) if [ -L "${file}" ]; then - lchown ${PORTAGE_INST_UID} "${file}" + lchown ${PORTAGE_INST_UID:-0} "${file}" else s=$(stat_perms "$file") if [ -z "${s}" ]; then ewarn "failed stat_perm'ing $file. User intervention during install isn't wise..." continue fi - chown ${PORTAGE_INST_UID} "$file" + chown ${PORTAGE_INST_UID:-0} "$file" chmod "$s" "$file" fi done @@ -239,14 +239,14 @@ install_qa_check() { find "${D}/" -group portage | while read file; do count=$(( $count + 1 )) if [ -L "${file}" ]; then - lchgrp ${PORTAGE_INST_GID} "${file}" + lchgrp ${PORTAGE_INST_GID:-0} "${file}" else s=$(stat_perms "$file") if [ -z "${s}" ]; then echo "failed stat_perm'ing '$file' . User intervention during install isn't wise..." continue fi - chgrp ${PORTAGE_INST_GID} "$file" + chgrp ${PORTAGE_INST_GID:-0} "$file" chmod "$s" "$file" fi done |