From d8f51019dd634453288540675f0148d15ae4735d Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Thu, 29 Sep 2005 16:28:19 +0000 Subject: [PATCH] overridable lchown/lchgrp svn path=/main/branches/2.0/; revision=2045 --- bin/ebuild.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 3d1fca10d..ed3bd94f2 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -83,6 +83,15 @@ addpredict() export SANDBOX_PREDICT="$SANDBOX_PREDICT:$1" } +lchown() +{ + chown -h "$@" +} + +lchgrp() +{ + chgrp -h "$@" +} # source the existing profile.bashrc's. save_IFS @@ -982,6 +991,8 @@ dyn_test() { } +PORTAGE_INST_UID="0" +PORTAGE_INST_GID="0" dyn_install() { trap "abort_install" SIGINT SIGQUIT @@ -1119,15 +1130,17 @@ dyn_install() { local count=0 find "${D}/" -user portage | while read file; do count=$(( $count + 1 )) - if [ ! -L "${file}" ]; then - s=$(stat_perms "$file") + if [ -L "${file}" ]; then + lchown ${PORTAGE_INST_UID} "${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" + chmod "$s" "$file" fi - chown root "$file" - [[ ! -L "${file}" ]] && chmod "$s" "$file" done if (( $count > 0 )); then ewarn "$count files were installed with user portage!" @@ -1136,15 +1149,17 @@ dyn_install() { count=0 find "${D}/" -group portage | while read file; do count=$(( $count + 1 )) - if [ ! -L "${file}" ]; then + if [ -L ${file} ]; then + lchgrp ${PORTAGE_INST_GID} "${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" + chmod "$s" "$file" fi - chgrp 0 "${file}" - [[ ! -L "${file}" ]] && chmod "$s" "$file" done if (( $count > 0 )); then ewarn "$count files were installed with group portage!" -- 2.26.2