Support FEATURES=force-prefix.
[portage.git] / bin / ebuild-helpers / fowners
1 #!/bin/bash
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
7 [[ " ${FEATURES} " == *" force-prefix "* ]] || \
8         case "$EAPI" in 0|1|2) ED=${D} ;; esac
9
10 # we can't prefix all arguments because
11 # chown takes random options
12 slash="/"
13 chown "${@/#${slash}/${ED}${slash}}"
14 ret=$?
15 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
16 exit $ret