From: Zac Medico Date: Wed, 27 Oct 2010 15:27:30 +0000 (-0700) Subject: debug-print: permission fixes X-Git-Tag: v2.1.9.23~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9de0e245d102b497c6c498afeb156819e4f9d2d9;p=portage.git debug-print: permission fixes --- 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