--- chown.orig 2013-05-22 13:07:26.609145740 +0200 +++ chown 2013-05-22 13:31:52.379131761 +0200 @@ -7,24 +7,27 @@ IFS=':' +outputfile=/tmp/chownOut 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:-/big/local/gentoo-prefix/usr/lib/portage/bin}"/isolated-functions.sh + "${path}/${scriptname}" "$@" 2>&1 > ${outputfile} + if [ -f ${outputfile} ] ; then + source "${PORTAGE_BIN_PATH:-/big/local/gentoo-prefix2/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}'} + sed -i "s/${D}/'${D}'/g" ${outputfile} if [[ -n ${EPREFIX} ]] ; then - msg=${msg//${EPREFIX}/'${EPREFIX}'} - msg=${msg//${EPREFIX#/}/'${EPREFIX}'} + sed -i "s/${EPREFIX}/'${EPREFIX}'/g" ${outputfile} + sed -i "s/${EPREFIX#/}/'${EPREFIX}'/g" ${outputfile} fi + + output=$(<${outputfile}) + msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}" ewarn "${msg}" fi exit 0