summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-27 08:27:30 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-27 08:30:47 -0700
commit9de0e245d102b497c6c498afeb156819e4f9d2d9 (patch)
tree9725b2df31d7174e47a6664099d3d67cabe7bcc8 /bin
parent0c4fd330a28efd73f0609d7d4dccb075cde132e4 (diff)
downloadportage-9de0e245d102b497c6c498afeb156819e4f9d2d9.tar.gz
portage-9de0e245d102b497c6c498afeb156819e4f9d2d9.tar.bz2
portage-9de0e245d102b497c6c498afeb156819e4f9d2d9.zip
debug-print: permission fixes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index e67dd6366..c56d892b9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1275,10 +1275,13 @@ debug-print() {
printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}"
fi
- # default target
- printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
- # let the portage user own/write to this file
- chmod g+w "${T}/eclass-debug.log" &>/dev/null
+ if [[ -w $T ]] ; then
+ # default target
+ printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
+ # let the portage user own/write to this file
+ chgrp portage "${T}/eclass-debug.log" &>/dev/null
+ chmod g+w "${T}/eclass-debug.log" &>/dev/null
+ fi
}
# The following 2 functions are debug-print() wrappers