diff options
Diffstat (limited to 'bin/ebuild-helpers')
-rwxr-xr-x | bin/ebuild-helpers/fowners | 5 | ||||
l--------- | bin/ebuild-helpers/unprivileged/chgrp | 1 | ||||
-rwxr-xr-x | bin/ebuild-helpers/unprivileged/chown | 33 |
3 files changed, 34 insertions, 5 deletions
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners index b664ec766..cee4108ce 100755 --- a/bin/ebuild-helpers/fowners +++ b/bin/ebuild-helpers/fowners @@ -14,10 +14,5 @@ slash="/" chown "${@/#${slash}/${ED}${slash}}" ret=$? -if [[ ${ret} != 0 && -n ${EPREFIX} && ${EUID} != 0 ]] ; then - ewarn "fowners failure ignored in Prefix with non-privileged user" - exit 0 -fi - [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed" exit $ret diff --git a/bin/ebuild-helpers/unprivileged/chgrp b/bin/ebuild-helpers/unprivileged/chgrp new file mode 120000 index 000000000..6fb0fcd80 --- /dev/null +++ b/bin/ebuild-helpers/unprivileged/chgrp @@ -0,0 +1 @@ +chown
\ No newline at end of file diff --git a/bin/ebuild-helpers/unprivileged/chown b/bin/ebuild-helpers/unprivileged/chown new file mode 100755 index 000000000..cad34d947 --- /dev/null +++ b/bin/ebuild-helpers/unprivileged/chown @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +scriptpath=${BASH_SOURCE[0]} +scriptname=${scriptpath##*/} + +IFS=':' + +for path in ${PATH}; do + [[ -x ${path}/${scriptname} ]] || continue + [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue + IFS=$' \t\n' + output=$("${path}/${scriptname}" "$@" 2>&1) + if [[ $? -ne 0 ]] ; then + source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh + + if ! ___eapi_has_prefix_variables; then + EPREFIX= + fi + msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}" + # Reverse expansion of ${D} and ${EPREFIX}, for readability. + msg=${msg//${D}/'${D}'} + if [[ -n ${EPREFIX} ]] ; then + msg=${msg//${EPREFIX}/'${EPREFIX}'} + msg=${msg//${EPREFIX#/}/'${EPREFIX}'} + fi + ewarn "${msg}" + fi + exit 0 +done + +exit 1 |