Index: baselayout/baselayout-2.2.ebuild =================================================================== --- baselayout.orig/baselayout-2.2.ebuild +++ baselayout/baselayout-2.2.ebuild @@ -150,6 +150,23 @@ pkg_preinst() { } src_prepare() { + if use prefix; then + sed -i -r\ + -e "/PATH=/!s:/(etc|usr/bin|bin):\"${EPREFIX}\"/\1:g" \ + -e "/PATH=/s|([:\"])/|\1${EPREFIX}/|g" \ + -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \ + -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \ + etc/profile || die + sed -i -r \ + -e "s:/(etc/env.d|opt|usr):${EPREFIX}/\1:g" \ + -e "/^PATH=/s|\"$|:${EPREFIX}/usr/sbin:${EPREFIX}/sbin\"|" \ + etc/env.d/00basic || die + sed -i "s:/bin:${EPREFIX}/bin:" etc/shells || die + sed -i -r \ + -e "s,:/(root|bin|sbin|var|),:${EPREFIX}/\1,g" \ + share.Linux/passwd || die + fi + # handle multilib paths. do it here because we want this behavior # regardless of the C library that you're using. we do explicitly # list paths which the native ldconfig searches, but this isn't