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
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
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
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' \
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
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