summaryrefslogtreecommitdiffstats
path: root/bin/ebuild-helpers
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-29 15:25:23 -0700
committerZac Medico <zmedico@gentoo.org>2012-03-29 15:25:23 -0700
commitec974a0d7637fff2dc2d57917f6dbb5c348c5e7d (patch)
tree05fe79f9d2d88306e2a03e1d293a1bceef753543 /bin/ebuild-helpers
parent3ff6c0d01a074169b8afeddc668191541f5e4330 (diff)
downloadportage-ec974a0d7637fff2dc2d57917f6dbb5c348c5e7d.tar.gz
portage-ec974a0d7637fff2dc2d57917f6dbb5c348c5e7d.tar.bz2
portage-ec974a0d7637fff2dc2d57917f6dbb5c348c5e7d.zip
fowners: return success for prefix if EUID != 0
This is based on a patch by Jeremy Olexa from bug #409893.
Diffstat (limited to 'bin/ebuild-helpers')
-rwxr-xr-xbin/ebuild-helpers/fowners10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
index a5a28f2fb..a213c9eb1 100755
--- a/bin/ebuild-helpers/fowners
+++ b/bin/ebuild-helpers/fowners
@@ -1,16 +1,22 @@
#!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
[[ " ${FEATURES} " == *" force-prefix "* ]] || \
- case "$EAPI" in 0|1|2) ED=${D} ;; esac
+ case "$EAPI" in 0|1|2) EPREFIX= ED=${D} ;; esac
# we can't prefix all arguments because
# chown takes random options
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