Add EPREFIX and ED support in all ebuild helpers.
authorZac Medico <zmedico@gentoo.org>
Wed, 2 Nov 2011 02:17:19 +0000 (19:17 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Nov 2011 02:17:19 +0000 (19:17 -0700)
This allows our prefix tests to use helpers like insinto, doins, and dosym.

31 files changed:
bin/dohtml.py
bin/ebuild-helpers/dobin
bin/ebuild-helpers/dodir
bin/ebuild-helpers/dodoc
bin/ebuild-helpers/doexe
bin/ebuild-helpers/dohard
bin/ebuild-helpers/doinfo
bin/ebuild-helpers/doins
bin/ebuild-helpers/dolib
bin/ebuild-helpers/doman
bin/ebuild-helpers/domo
bin/ebuild-helpers/dosbin
bin/ebuild-helpers/dosed
bin/ebuild-helpers/dosym
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/fowners
bin/ebuild-helpers/fperms
bin/ebuild-helpers/prepall
bin/ebuild-helpers/prepalldocs
bin/ebuild-helpers/prepallinfo
bin/ebuild-helpers/prepallman
bin/ebuild-helpers/prepallstrip
bin/ebuild-helpers/prepinfo
bin/ebuild-helpers/preplib
bin/ebuild-helpers/prepman
bin/ebuild-helpers/prepstrip
bin/ebuild.sh
bin/misc-functions.sh
bin/phase-functions.sh
bin/phase-helpers.sh
pym/portage/tests/emerge/test_simple.py

index 00258ec9e22b942863c2012285a11eb46fa27ce7..122daf3f5ce7f9ff55e0a99f70dab0ec033baf36 100755 (executable)
@@ -56,9 +56,9 @@ def install(basename, dirname, options, prefix=""):
                fullpath = dirname + "/" + fullpath
 
        if options.DOCDESTTREE:
-               destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
+               destdir = options.ED + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
        else:
-               destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
+               destdir = options.ED + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
 
        if not os.path.exists(fullpath):
                sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath)
@@ -86,13 +86,15 @@ def install(basename, dirname, options, prefix=""):
 class OptionsClass:
        def __init__(self):
                self.PF = ""
-               self.D = ""
+               self.ED = ""
                self.DOCDESTTREE = ""
                
                if "PF" in os.environ:
                        self.PF = os.environ["PF"]
-               if "D" in os.environ:
-                       self.D = os.environ["D"]
+               if os.environ.get("EAPI", "0") in ("0", "1", "2"):
+                       self.ED = os.environ.get("D", "")
+               else:
+                       self.ED = os.environ.get("ED", "")
                if "_E_DOCDESTTREE_" in os.environ:
                        self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"]
                
index e385455d7d2fd80d6c0d9082449e6bd719ace335..af3af0d841783aacf1a86d7ebc16bf6efcde4b20 100755 (executable)
@@ -9,15 +9,17 @@ if [[ $# -lt 1 ]] ; then
        exit 1
 fi
 
-if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
-       install -d "${D}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${D}${DESTTREE}/bin"; exit 2; }
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
+       install -d "${ED}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
 fi
 
 ret=0
 
 for x in "$@" ; do
        if [[ -e ${x} ]] ; then
-               install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin"
+               install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/bin"
        else
                echo "!!! ${0##*/}: $x does not exist" 1>&2
                false
index f40bee7e48f6db5395d0717d8db67fc8a76e7dcf..7db7cafb141b10590f50bf3e0e5a6f6f55182ea9 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
-install -d ${DIROPTIONS} "${@/#/${D}/}"
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+install -d ${DIROPTIONS} "${@/#/${ED}/}"
 ret=$?
 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
 exit $ret
index 65713db1a4b0778a0974a9d3723e3f658706973f..37bbc79d037b947d473ecf201875dc6c9da59bf1 100755 (executable)
@@ -9,7 +9,9 @@ if [ $# -lt 1 ] ; then
        exit 1  
 fi
 
-dir="${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
 if [ ! -d "${dir}" ] ; then
        install -d "${dir}"
 fi
index 360800e02e5ea0cb5a35700c9fdc1743dd91372c..a5b9af0ebc04ea72a20febdd043425c313737a73 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,8 +9,10 @@ if [[ $# -lt 1 ]] ; then
        exit 1
 fi
 
-if [[ ! -d ${D}${_E_EXEDESTTREE_} ]] ; then
-       install -d "${D}${_E_EXEDESTTREE_}"
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
+       install -d "${ED}${_E_EXEDESTTREE_}"
 fi
 
 TMP=$T/.doexe_tmp
@@ -29,7 +31,7 @@ for x in "$@" ; do
                mysrc="${x}"
        fi
        if [ -e "$mysrc" ] ; then
-               install $EXEOPTIONS "$mysrc" "$D$_E_EXEDESTTREE_"
+               install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_"
        else
                echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
                false
index 22704876ce1f897cec3d1f5c961e17e0f0e91fd2..cf6fb112dff8a47f731aa6b9f186fb4b03724a56 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 if [[ $# -ne 2 ]] ; then
@@ -7,7 +7,9 @@ if [[ $# -ne 2 ]] ; then
        exit 1
 fi
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
 
-exec ln -f "${D}$1" "${D}$2"
+exec ln -f "${ED}$1" "${ED}$2"
index 54fb8dac2ead471904fd93eed326bd537b2b4f16..a922ef1be307ae11e47295b7715445b1e8f3a3be 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,11 +9,13 @@ if [[ -z $1 ]] ; then
        exit 1  
 fi
 
-if [[ ! -d ${D}usr/share/info ]] ; then
-       install -d "${D}usr/share/info" || { helpers_die "${0##*/}: failed to install ${D}usr/share/info"; exit 1; }
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}usr/share/info ]] ; then
+       install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
 fi
 
-install -m0644 "$@" "${D}usr/share/info"
+install -m0644 "$@" "${ED}usr/share/info"
 rval=$?
 if [ $rval -ne 0 ] ; then
        for x in "$@" ; do
index 7dec146825b8991a8a2e4683ed83b9257faa578e..b9189d5ed90a076e7349462736e5824b82444658 100755 (executable)
@@ -27,12 +27,14 @@ else
        DOINSRECUR=n
 fi
 
-if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
+case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
+
+if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then
        vecho "-------------------------------------------------------" 1>&2
-       vecho "You should not use \${D} with helpers." 1>&2
+       vecho "You should not use \${D} or \${ED} with helpers." 1>&2
        vecho "  --> ${INSDESTTREE}" 1>&2
        vecho "-------------------------------------------------------" 1>&2
-       helpers_die "${0##*/} used with \${D}"
+       helpers_die "${0##*/} used with \${D} or \${ED}"
        exit 1
 fi
 
@@ -49,7 +51,7 @@ export TMP=$T/.doins_tmp
 # Use separate directories to avoid potential name collisions.
 mkdir -p "$TMP"/{1,2}
 
-[[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
+[[ ! -d ${ED}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
 
 _doins() {
        local mysrc="$1" mydir="$2" cleanup="" rval
@@ -63,8 +65,8 @@ _doins() {
                # $PORTAGE_ACTUAL_DISTDIR/.
                if [ $PRESERVE_SYMLINKS = y ] && \
                        ! [[ $(readlink "$mysrc") == "$PORTAGE_ACTUAL_DISTDIR"/* ]] ; then
-                       rm -rf "$D$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
-                       cp -P "$mysrc" "$D$INSDESTTREE/$mydir/${mysrc##*/}"
+                       rm -rf "${ED}$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
+                       cp -P "$mysrc" "${ED}$INSDESTTREE/$mydir/${mysrc##*/}"
                        return $?
                else
                        cp "$mysrc" "$TMP/2/${mysrc##*/}" || return $?
@@ -73,7 +75,7 @@ _doins() {
                fi
        fi
 
-       install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}"
+       install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}"
        rval=$?
        [[ -n ${cleanup} ]] && rm -f "${cleanup}"
        [ $rval -ne 0 ] && echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
index 87ade425aa9e17a121ce6cb9195fd99d5d77f217..9dd11d85703e32f4b40180b80146105e9f11f567 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 # Setup ABI cruft
 LIBDIR_VAR="LIBDIR_${ABI}"
 if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
@@ -12,7 +14,7 @@ fi
 unset LIBDIR_VAR
 # we need this to default to lib so that things dont break
 CONF_LIBDIR=${CONF_LIBDIR:-lib}
-libdir="${D}${DESTTREE}/${CONF_LIBDIR}"
+libdir="${ED}${DESTTREE}/${CONF_LIBDIR}"
 
 
 if [[ $# -lt 1 ]] ; then
index 4561bef1810ba070f45851bb419d9d0888f073a9..27401f3b3feba6876114bba6884285e7f24f467c 100755 (executable)
@@ -9,6 +9,8 @@ if [[ $# -lt 1 ]] ; then
        exit 1
 fi
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 i18n=""
 
 ret=0
@@ -44,11 +46,11 @@ for x in "$@" ; do
 
        if [[ ${mandir} == *man[0-9n] ]] ; then
                if [[ -s ${x} ]] ; then
-                       if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then
-                               install -d "${D}/usr/share/man/${mandir}"
+                       if [[ ! -d ${ED}/usr/share/man/${mandir} ]] ; then
+                               install -d "${ED}/usr/share/man/${mandir}"
                        fi
 
-                       install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}"
+                       install -m0644 "${x}" "${ED}/usr/share/man/${mandir}/${name}"
                        ((ret|=$?))
                elif [[ ! -e ${x} ]] ; then
                        echo "!!! ${0##*/}: $x does not exist" 1>&2
index 4737f44e10e7ba5a0506847d21a76fc50cf82c05..0e3656d588f3d69533798171b090b8987051fb8a 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,8 +9,11 @@ if [ ${mynum} -lt 1 ] ; then
        helpers_die "${0}: at least one argument needed"
        exit 1
 fi
-if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
-       install -d "${D}${DESTTREE}/share/locale/"
+
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
+       install -d "${ED}${DESTTREE}/share/locale/"
 fi
 
 ret=0
@@ -18,7 +21,7 @@ ret=0
 for x in "$@" ; do
        if [ -e "${x}" ] ; then
                mytiny="${x##*/}"
-               mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES"
+               mydir="${ED}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES"
                if [ ! -d "${mydir}" ] ; then
                        install -d "${mydir}"
                fi
index 87a30914afd472bb3706f0528d1356075555e041..d0783ed33a271a08f0c05098a23a7852c99c3630 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,15 +9,17 @@ if [[ $# -lt 1 ]] ; then
        exit 1
 fi
 
-if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
-       install -d "${D}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${D}${DESTTREE}/sbin"; exit 2; }
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
+       install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
 fi
 
 ret=0
 
 for x in "$@" ; do
        if [[ -e ${x} ]] ; then
-               install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/sbin"
+               install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/sbin"
        else
                echo "!!! ${0##*/}: ${x} does not exist" 1>&2
                false
index afc949ba53b4fb48935acefad7e41ab76463197e..00cf5da17d71127ced55ce5454e84b5e9dbc15a6 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 if [[ $# -lt 1 ]] ; then
@@ -7,12 +7,14 @@ if [[ $# -lt 1 ]] ; then
        exit 1
 fi
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 ret=0
 file_found=0
-mysed="s:${D}::g"
+mysed="s:${ED}::g"
 
 for x in "$@" ; do
-       y=$D${x#/}
+       y=$ED${x#/}
        if [ -e "${y}" ] ; then
                if [ -f "${y}" ] ; then
                        file_found=1
index 7dd4c6d5146cea25f02e2f2a3748577edaf3c56a..8b7b304ee869258f20e827e6739abdac4d58abbd 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,16 +9,18 @@ if [[ $# -ne 2 ]] ; then
        exit 1
 fi
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 if [[ ${2} == */ ]] || \
-       [[ -d ${D}${2} && ! -L ${D}${2} ]] ; then
+       [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
        # implicit basename not allowed by PMS (bug #379899)
        eqawarn "QA Notice: dosym target omits basename: '${2}'"
 fi
 
 destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
 
-ln -snf "$1" "${D}$2"
+ln -snf "$1" "${ED}$2"
 ret=$?
 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
 exit $ret
index 7a95120a98ba0eec3854a67b68f1f8e077ef6e3d..76c2718612cb57bf6479a6267936d20d2a0e65f3 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,19 +9,21 @@ if [[ -z $1 ]] ; then
        exit 1
 fi
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 case $1 in
        --ignore)
                shift
                for skip in "$@" ; do
-                       [[ -d ${D}${skip} || -f ${D}${skip} ]] \
-                               && >> "${D}${skip}.ecompress.skip"
+                       [[ -d ${ED}${skip} || -f ${ED}${skip} ]] \
+                               && >> "${ED}${skip}.ecompress.skip"
                done
                exit 0
                ;;
        --queue)
                shift
                set -- "${@/%/.ecompress.dir}"
-               set -- "${@/#/${D}}"
+               set -- "${@/#/${ED}}"
                ret=0
                for x in "$@" ; do
                        >> "$x"
@@ -32,10 +34,10 @@ case $1 in
                ;;
        --dequeue)
                [[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
-               find "${D}" -name '*.ecompress.dir' -print0 \
-                       | sed -e 's:\.ecompress\.dir::g' -e "s:${D}:/:g" \
+               find "${ED}" -name '*.ecompress.dir' -print0 \
+                       | sed -e 's:\.ecompress\.dir::g' -e "s:${ED}:/:g" \
                        | ${XARGS} -0 ecompressdir
-               find "${D}" -name '*.ecompress.skip' -print0 | ${XARGS} -0 rm -f
+               find "${ED}" -name '*.ecompress.skip' -print0 | ${XARGS} -0 rm -f
                exit 0
                ;;
        --*)
@@ -95,8 +97,8 @@ _relocate_skip_dirs() {
                mv "${src}.ecompress.skip" "${dst}.ecompress.skip"
        done
 }
-hide_skip_dirs()    { _relocate_skip_dirs "${D}" "${T}"/ecompress-skip/ ; }
-restore_skip_dirs() { _relocate_skip_dirs "${T}"/ecompress-skip/ "${D}" ; }
+hide_skip_dirs()    { _relocate_skip_dirs "${ED}" "${T}"/ecompress-skip/ ; }
+restore_skip_dirs() { _relocate_skip_dirs "${T}"/ecompress-skip/ "${ED}" ; }
 
 ret=0
 
@@ -104,9 +106,9 @@ rm -rf "${T}"/ecompress-skip
 
 for dir in "$@" ; do
        dir=${dir#/}
-       dir="${D}${dir}"
+       dir="${ED}${dir}"
        if [[ ! -d ${dir} ]] ; then
-               vecho "${0##*/}: /${dir#${D}} does not exist!"
+               vecho "${0##*/}: /${dir#${ED}} does not exist!"
                continue
        fi
        cd "${dir}"
@@ -132,7 +134,7 @@ for dir in "$@" ; do
 
        # now lets do our work
        [[ -z ${suffix} ]] && continue
-       vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${D}}"
+       vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED}}"
        funk_up_dir "compress" "${suffix}" "ecompress"
 
        # finally, restore the skipped stuff
index 4cc6bfaccedef8d3f75ac1a2ef68f0ee382098e0..3f51b4e540527eac1fdb66646ffdd2db2378018d 100755 (executable)
@@ -1,13 +1,15 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 # we can't prefix all arguments because
 # chown takes random options
 slash="/"
-chown "${@/#${slash}/${D}${slash}}"
+chown "${@/#${slash}/${ED}${slash}}"
 ret=$?
 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
 exit $ret
index 0260bdc476248bde0596f5aa8f1cd777db51b510..9a2971ae568ede6e16008e868a7437e709a51efb 100755 (executable)
@@ -1,13 +1,14 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
 # we can't prefix all arguments because
 # chmod takes random options
 slash="/"
-chmod "${@/#${slash}/${D}${slash}}"
+chmod "${@/#${slash}/${ED}${slash}}"
 ret=$?
 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
 exit $ret
index 701ecba213734e4a64992610a5176fa298ae9b22..611c4ce79348793c88c33ea7a425d53c4988a81c 100755 (executable)
@@ -4,12 +4,14 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 if has chflags $FEATURES ; then
        # Save all the file flags for restoration at the end of prepall.
-       mtree -c -p "${D}" -k flags > "${T}/bsdflags.mtree"
+       mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
        # Remove all the file flags so that prepall can do anything necessary.
-       chflags -R noschg,nouchg,nosappnd,nouappnd "${D}"
-       chflags -R nosunlnk,nouunlnk "${D}" 2>/dev/null
+       chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+       chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
 fi
 
 prepallman
@@ -19,5 +21,5 @@ prepallstrip
 
 if has chflags $FEATURES ; then
        # Restore all the file flags that were saved at the beginning of prepall.
-       mtree -U -e -p "${D}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
+       mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
 fi
index fdc735d6fc35ed7630d5d41b344674169575f4cb..540d02500baa1aeabbde6a5a4bb1aa74d54bd779 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -8,8 +8,9 @@ if [[ -n $1 ]] ; then
        vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
 fi
 
-cd "${D}"
-[[ -d usr/share/doc ]] || exit 0
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+[[ -d ${ED}usr/share/doc ]] || exit 0
 
 ecompressdir --ignore /usr/share/doc/${PF}/html
 ecompressdir --queue /usr/share/doc
index 0d978034b24d086a3b76509f27a225ac292f2fd3..e351f878bec3348dcd73cef4dd684c0a562fc342 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
-[[ ! -d ${D}usr/share/info ]] && exit 0
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+[[ -d ${ED}usr/share/info ]] || exit 0
 
 exec prepinfo
index e50de6d67e97a6623d23bc5b7c6f7c2e9fe40124..be7f19453d53d47b349bcee2a4b9e70a4b52260e 100755 (executable)
@@ -7,11 +7,13 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 # replaced by controllable compression in EAPI 4
 has "${EAPI}" 0 1 2 3 || exit 0
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 ret=0
 
-find "${D}" -type d -name man > "${T}"/prepallman.filelist
+find "${ED}" -type d -name man > "${T}"/prepallman.filelist
 while read -r mandir ; do
-       mandir=${mandir#${D}}
+       mandir=${mandir#${ED}}
        prepman "${mandir%/man}"
        ((ret|=$?))
 done < "${T}"/prepallman.filelist
index ec12ce663197ff1938c47589d1b233ed402a58d8..e9f5f8e3e65a531f6aa4d4e39282f2b9ae9facfe 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-exec prepstrip "${D}"
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+exec prepstrip "${ED}"
index 691fd1372bf16aaea72d2376899878e4bbfff48f..afe214c6b9e2a66388ff0042e11269eee65cf526 100755 (executable)
@@ -4,17 +4,19 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 if [[ -z $1 ]] ; then
        infodir="/usr/share/info"
 else
-       if [[ -d ${D}$1/share/info ]] ; then
+       if [[ -d ${ED}$1/share/info ]] ; then
                infodir="$1/share/info"
        else
                infodir="$1/info"
        fi
 fi
 
-if [[ ! -d ${D}${infodir} ]] ; then
+if [[ ! -d ${ED}${infodir} ]] ; then
        if [[ -n $1 ]] ; then
                vecho "${0##*/}: '${infodir}' does not exist!"
                exit 1
@@ -23,7 +25,7 @@ if [[ ! -d ${D}${infodir} ]] ; then
        fi
 fi
 
-find "${D}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do
+find "${ED}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do
        for f in "${x}"/.keepinfodir*; do
                [[ -e ${f} ]] && continue 2
        done
index 76aabe64c098f0496bf5d34bfbba49355be507ca..8c62921010b17aa16b2b2ffa22897f2afe2db753 100755 (executable)
@@ -1,11 +1,13 @@
 #!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
 eqawarn "QA Notice: Deprecated call to 'preplib'"
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 LIBDIR_VAR="LIBDIR_${ABI}"
 if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
        CONF_LIBDIR="${!LIBDIR_VAR}"
@@ -18,9 +20,9 @@ if [ -z "${CONF_LIBDIR}" ]; then
 fi
 
 if [ -z "$1" ] ; then
-       z="${D}usr/${CONF_LIBDIR}"
+       z="${ED}usr/${CONF_LIBDIR}"
 else
-       z="${D}$1/${CONF_LIBDIR}"
+       z="${ED}$1/${CONF_LIBDIR}"
 fi
 
 if [ -d "${z}" ] ; then
index c9add8a30662826c47194f35bd359f8c9546304b..8ea7607df87f1486a6274616a81317265e3dac5c 100755 (executable)
@@ -4,14 +4,16 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 if [[ -z $1 ]] ; then 
-       mandir="${D}usr/share/man"
+       mandir="${ED}usr/share/man"
 else
-       mandir="${D}$1/man"
+       mandir="${ED}$1/man"
 fi
 
 if [[ ! -d ${mandir} ]] ; then
-       eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${D}}'"
+       eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${ED}}'"
        exit 0
 fi
 
@@ -27,6 +29,6 @@ for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
        [[ -d ${subdir} ]] && really_is_mandir=1 && break
 done
 
-[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --queue "${mandir#${D}}"
+[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --queue "${mandir#${ED}}"
 
 exit 0
index 8c2ca4839573dbcff156065cd19cf37dd516004b..fac20b24f6fd06bf35aa1f5345af7bfa83bf8aca 100755 (executable)
@@ -18,6 +18,8 @@ exp_tf() {
 exp_tf FEATURES installsources nostrip splitdebug
 exp_tf RESTRICT binchecks installsources strip
 
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
 banner=false
 SKIP_STRIP=false
 if ${RESTRICT_strip} || ${FEATURES_nostrip} ; then
@@ -99,7 +101,7 @@ save_elf_debug() {
        ${FEATURES_splitdebug} || return 0
 
        local x=$1
-       local y="${D}usr/lib/debug/${x:${#D}}.debug"
+       local y="${ED}usr/lib/debug/${x:${#ED}}.debug"
 
        # dont save debug info twice
        [[ ${x} == *".debug" ]] && return 0
@@ -108,7 +110,7 @@ save_elf_debug() {
 
        local inode=$(inode_var_name "$x")
        if [[ -n ${!inode} ]] ; then
-               ln "${D}usr/lib/debug/${!inode:${#D}}.debug" "$y"
+               ln "${ED}usr/lib/debug/${!inode:${#ED}}.debug" "$y"
        else
                eval $inode=\$x
                if [[ -e ${T}/prepstrip.split.debug ]] ; then
@@ -129,18 +131,18 @@ save_elf_debug() {
                        | awk '$NF ~ /GNU/ { getline; printf $2$3$4$5; getline; print $2 }')
        fi
        if [[ -n ${buildid} ]] ; then
-               local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}"
+               local buildid_dir="${ED}usr/lib/debug/.build-id/${buildid:0:2}"
                local buildid_file="${buildid_dir}/${buildid:2}"
                mkdir -p "${buildid_dir}"
-               ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
-               ln -s "/${x:${#D}}" "${buildid_file}"
+               ln -s "../../${x:${#ED}}.debug" "${buildid_file}.debug"
+               ln -s "/${x:${#ED}}" "${buildid_file}"
        fi
 }
 
 process_elf() {
        local x=$1 strip_flags=${*:2}
 
-       vecho "   ${x:${#D}}"
+       vecho "   ${x:${#ED}}"
        save_elf_sources "${x}"
 
        if ${strip_this} ; then
@@ -165,7 +167,7 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
        log=$T/scanelf-already-stripped.log
        qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
        [[ -n ${!qa_var} ]] && QA_PRESTRIPPED="${!qa_var}"
-       scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^$D##" > "$log"
+       scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "$log"
        if [[ -n $QA_PRESTRIPPED && -s $log && \
                ${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
                shopts=$-
@@ -206,7 +208,7 @@ do
                set -o noglob
                strip_this=true
                for m in $(eval echo ${STRIP_MASK}) ; do
-                       [[ /${x#${D}} == ${m} ]] && strip_this=false && break
+                       [[ /${x#${ED}} == ${m} ]] && strip_this=false && break
                done
                set +o noglob
        else
@@ -221,7 +223,7 @@ do
 
        buildid=
        if [[ ${f} == *"current ar archive"* ]] ; then
-               vecho "   ${x:${#D}}"
+               vecho "   ${x:${#ED}}"
                if ${strip_this} ; then
                        # hmm, can we split debug/sources for .a ?
                        ${STRIP} -g "${x}"
@@ -239,10 +241,10 @@ if [[ -s ${T}/debug.sources ]] && \
    ${debugedit_found}
 then
        vecho "installsources: rsyncing source files"
-       [[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
+       [[ -d ${ED}${prepstrip_sources_dir} ]] || mkdir -p "${ED}${prepstrip_sources_dir}"
        grep -zv '/<[^/>]*>$' "${T}"/debug.sources | \
                (cd "${WORKDIR}"; LANG=C sort -z -u | \
-               rsync -tL0 --files-from=- "${WORKDIR}/" "${D}${prepstrip_sources_dir}/" )
+               rsync -tL0 --files-from=- "${WORKDIR}/" "${ED}${prepstrip_sources_dir}/" )
 
        # Preserve directory structure.
        # Needed after running save_elf_sources.
@@ -250,5 +252,5 @@ then
        while read -r -d $'\0' emptydir
        do
                >> "$emptydir"/.keepdir
-       done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0)
+       done < <(find "${ED}${prepstrip_sources_dir}/" -type d -empty -print0)
 fi
index 7b77c10771057eaa6780dc8d4859937e12e24017..5648a97623985dfd67e524e916a9ea1edcaa413c 100755 (executable)
@@ -597,17 +597,19 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
                        PATH=$_ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
                        unset _ebuild_helpers_path
 
+                       _eprefix=${EPREFIX}
+                       case "$EAPI" in 0|1|2) _eprefix= ;; esac
                        # Use default ABI libdir in accordance with bug #355283.
                        x=LIBDIR_${DEFAULT_ABI}
                        [[ -n $DEFAULT_ABI && -n ${!x} ]] && x=${!x} || x=lib
 
                        if has distcc $FEATURES ; then
-                               PATH="/usr/$x/distcc/bin:$PATH"
+                               PATH="${_eprefix}/usr/$x/distcc/bin:$PATH"
                                [[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
                        fi
 
                        if has ccache $FEATURES ; then
-                               PATH="/usr/$x/ccache/bin:$PATH"
+                               PATH="${_eprefix}/usr/$x/ccache/bin:$PATH"
 
                                if [[ -n $CCACHE_DIR ]] ; then
                                        addread "$CCACHE_DIR"
@@ -617,7 +619,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
                                [[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
                        fi
 
-                       unset x
+                       unset x _eprefix
 
                        if [[ -n $QA_PREBUILT ]] ; then
 
index 80cd0f8b613f7295d8695926fac680fede053ea6..81bae76c7dffda4465974e784304c3e1f0dc8f26 100755 (executable)
@@ -17,7 +17,9 @@ shift $#
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
 
 install_symlink_html_docs() {
-       cd "${D}" || die "cd failed"
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
+       cd "${ed}" || die "cd failed"
        #symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
        if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
                local mydocdir docdir
@@ -64,11 +66,13 @@ canonicalize() {
 prepcompress() {
        local -a include exclude incl_d incl_f
        local f g i real_f real_d
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
 
        # Canonicalize path names and check for their existence.
-       real_d=$(canonicalize "${D}")
+       real_d=$(canonicalize "${ed}")
        for (( i = 0; i < ${#PORTAGE_DOCOMPRESS[@]}; i++ )); do
-               real_f=$(canonicalize "${D}${PORTAGE_DOCOMPRESS[i]}")
+               real_f=$(canonicalize "${ed}${PORTAGE_DOCOMPRESS[i]}")
                f=${real_f#"${real_d}"}
                if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
                then
@@ -79,7 +83,7 @@ prepcompress() {
                fi
        done
        for (( i = 0; i < ${#PORTAGE_DOCOMPRESS_SKIP[@]}; i++ )); do
-               real_f=$(canonicalize "${D}${PORTAGE_DOCOMPRESS_SKIP[i]}")
+               real_f=$(canonicalize "${ed}${PORTAGE_DOCOMPRESS_SKIP[i]}")
                f=${real_f#"${real_d}"}
                if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
                then
@@ -128,7 +132,7 @@ prepcompress() {
 
        # Split the include list into directories and files
        for f in "${include[@]}"; do
-               if [[ -d ${D}${f} ]]; then
+               if [[ -d ${ed}${f} ]]; then
                        incl_d[${#incl_d[@]}]=${f}
                else
                        incl_f[${#incl_f[@]}]=${f}
@@ -138,15 +142,17 @@ prepcompress() {
        # Queue up for compression.
        # ecompress{,dir} doesn't like to be called with empty argument lists.
        [[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --queue "${incl_d[@]}"
-       [[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${D}}"
+       [[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ed}}"
        [[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}"
        return 0
 }
 
 install_qa_check() {
        local f i x
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
 
-       cd "${D}" || die "cd failed"
+       cd "${ed}" || die "cd failed"
 
        export STRIP_MASK
        prepall
@@ -154,15 +160,12 @@ install_qa_check() {
        ecompressdir --dequeue
        ecompress --dequeue
 
-       local ed=${ED}
-       case "$EAPI" in 0|1|2) ed=${D} ;; esac
-
        # Prefix specific checks
        [[ ${ed} != ${D} ]] && install_qa_check_prefix
 
        f=
        for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do
-               [[ -d $D/$x ]] && f+="  $x\n"
+               [[ -d $ed/$x ]] && f+="  $x\n"
        done
 
        if [[ -n $f ]] ; then
@@ -172,7 +175,7 @@ install_qa_check() {
        fi
 
        # Now we look for all world writable files.
-       local unsafe_files=$(find "${D}" -type f -perm -2 | sed -e "s:^${D}:- :")
+       local unsafe_files=$(find "${ed}" -type f -perm -2 | sed -e "s:^${ed}:- :")
        if [[ -n ${unsafe_files} ]] ; then
                vecho "QA Security Notice: world writable file(s):"
                vecho "${unsafe_files}"
@@ -202,7 +205,7 @@ install_qa_check() {
                if [[ -n "${ROOT}" && "${ROOT}" != "/" ]]; then
                        forbidden_dirs+=" ${ROOT}"
                fi
-               local dir l rpath_files=$(scanelf -F '%F:%r' -qBR "${D}")
+               local dir l rpath_files=$(scanelf -F '%F:%r' -qBR "${ed}")
                f=""
                for dir in ${forbidden_dirs}; do
                        for l in $(echo "${rpath_files}" | grep -E ":${dir}|::|: "); do
@@ -216,7 +219,7 @@ install_qa_check() {
 
                # Reject set*id binaries with $ORIGIN in RPATH #260331
                x=$(
-                       find "${D}" -type f \( -perm -u+s -o -perm -g+s \) -print0 | \
+                       find "${ed}" -type f \( -perm -u+s -o -perm -g+s \) -print0 | \
                        xargs -0 scanelf -qyRF '%r %p' | grep '$ORIGIN'
                )
 
@@ -242,7 +245,7 @@ install_qa_check() {
                [[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var}
                [[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS=""
                export QA_TEXTRELS="${QA_TEXTRELS} lib*/modules/*.ko"
-               f=$(scanelf -qyRF '%t %p' "${D}" | grep -v 'usr/lib/debug/')
+               f=$(scanelf -qyRF '%t %p' "${ed}" | grep -v 'usr/lib/debug/')
                if [[ -n ${f} ]] ; then
                        scanelf -qyRAF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log
                        vecho -ne '\n'
@@ -282,7 +285,7 @@ install_qa_check() {
                                        [[ -n ${QA_STRICT_WX_LOAD} ]] && QA_WX_LOAD=""
                                        export QA_EXECSTACK="${QA_EXECSTACK} lib*/modules/*.ko"
                                        export QA_WX_LOAD="${QA_WX_LOAD} lib*/modules/*.ko"
-                                       f=$(scanelf -qyRAF '%e %p' "${D}" | grep -v 'usr/lib/debug/')
+                                       f=$(scanelf -qyRAF '%e %p' "${ed}" | grep -v 'usr/lib/debug/')
                                        ;;
                        esac
                        ;;
@@ -309,7 +312,7 @@ install_qa_check() {
                if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && [[ "${PN}" != *-bin ]] ; then
                        qa_var="QA_DT_HASH_${ARCH/-/_}"
                        eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
-                       f=$(scanelf -qyRF '%k %p' -k .hash "${D}" | sed -e "s:\.hash ::")
+                       f=$(scanelf -qyRF '%k %p' -k .hash "${ed}" | sed -e "s:\.hash ::")
                        if [[ -n ${f} ]] ; then
                                echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log
                                if [ "${QA_STRICT_DT_HASH-unset}" == unset ] ; then
@@ -391,7 +394,7 @@ install_qa_check() {
                # Check for shared libraries lacking SONAMEs
                qa_var="QA_SONAME_${ARCH/-/_}"
                eval "[[ -n \${!qa_var} ]] && QA_SONAME=(\"\${${qa_var}[@]}\")"
-               f=$(scanelf -ByF '%S %p' "${D}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${D}:/:")
+               f=$(scanelf -ByF '%S %p' "${ed}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ed}:/:")
                if [[ -n ${f} ]] ; then
                        echo "${f}" > "${T}"/scanelf-missing-SONAME.log
                        if [[ "${QA_STRICT_SONAME-unset}" == unset ]] ; then
@@ -425,7 +428,7 @@ install_qa_check() {
                # Check for shared libraries lacking NEEDED entries
                qa_var="QA_DT_NEEDED_${ARCH/-/_}"
                eval "[[ -n \${!qa_var} ]] && QA_DT_NEEDED=(\"\${${qa_var}[@]}\")"
-               f=$(scanelf -ByF '%n %p' "${D}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${D}:/:")
+               f=$(scanelf -ByF '%n %p' "${ed}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ed}:/:")
                if [[ -n ${f} ]] ; then
                        echo "${f}" > "${T}"/scanelf-missing-NEEDED.log
                        if [[ "${QA_STRICT_DT_NEEDED-unset}" == unset ]] ; then
@@ -459,7 +462,7 @@ install_qa_check() {
                PORTAGE_QUIET=${tmp_quiet}
        fi
 
-       local unsafe_files=$(find "${D}" -type f '(' -perm -2002 -o -perm -4002 ')')
+       local unsafe_files=$(find "${ed}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ed}:/:")
        if [[ -n ${unsafe_files} ]] ; then
                eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"
                eqawarn "${unsafe_files}"
@@ -479,8 +482,8 @@ install_qa_check() {
        # Sanity check syntax errors in init.d scripts
        local d
        for d in /etc/conf.d /etc/init.d ; do
-               [[ -d ${D}/${d} ]] || continue
-               for i in "${D}"/${d}/* ; do
+               [[ -d ${ed}/${d} ]] || continue
+               for i in "${ed}"/${d}/* ; do
                        [[ -L ${i} ]] && continue
                        # if empty conf.d/init.d dir exists (baselayout), then i will be "/etc/conf.d/*" and not exist
                        [[ ! -e ${i} ]] && continue
@@ -491,17 +494,17 @@ install_qa_check() {
        # this should help to ensure that all (most?) shared libraries are executable
        # and that all libtool scripts / static libraries are not executable
        local j
-       for i in "${D}"opt/*/lib{,32,64} \
-                "${D}"lib{,32,64}       \
-                "${D}"usr/lib{,32,64}   \
-                "${D}"usr/X11R6/lib{,32,64} ; do
+       for i in "${ed}"opt/*/lib{,32,64} \
+                "${ed}"lib{,32,64}       \
+                "${ed}"usr/lib{,32,64}   \
+                "${ed}"usr/X11R6/lib{,32,64} ; do
                [[ ! -d ${i} ]] && continue
 
                for j in "${i}"/*.so.* "${i}"/*.so ; do
                        [[ ! -e ${j} ]] && continue
                        [[ -L ${j} ]] && continue
                        [[ -x ${j} ]] && continue
-                       vecho "making executable: ${j#${D}}"
+                       vecho "making executable: ${j#${ed}}"
                        chmod +x "${j}"
                done
 
@@ -509,7 +512,7 @@ install_qa_check() {
                        [[ ! -e ${j} ]] && continue
                        [[ -L ${j} ]] && continue
                        [[ ! -x ${j} ]] && continue
-                       vecho "removing executable bit: ${j#${D}}"
+                       vecho "removing executable bit: ${j#${ed}}"
                        chmod -x "${j}"
                done
 
@@ -533,7 +536,7 @@ install_qa_check() {
        # http://bugs.gentoo.org/4411
        abort="no"
        local a s
-       for a in "${D}"usr/lib*/*.a ; do
+       for a in "${ed}"usr/lib*/*.a ; do
                s=${a%.a}.so
                if [[ ! -e ${s} ]] ; then
                        s=${s%usr/*}${s##*/usr/}
@@ -547,7 +550,7 @@ install_qa_check() {
        [[ ${abort} == "yes" ]] && die "add those ldscripts"
 
        # Make sure people don't store libtool files or static libs in /lib
-       f=$(ls "${D}"lib*/*.{a,la} 2>/dev/null)
+       f=$(ls "${ed}"lib*/*.{a,la} 2>/dev/null)
        if [[ -n ${f} ]] ; then
                vecho -ne '\n'
                eqawarn "QA Notice: Excessive files found in the / partition"
@@ -558,9 +561,9 @@ install_qa_check() {
 
        # Verify that the libtool files don't contain bogus $D entries.
        local abort=no gentoo_bug=no always_overflow=no
-       for a in "${D}"usr/lib*/*.la ; do
+       for a in "${ed}"usr/lib*/*.la ; do
                s=${a##*/}
-               if grep -qs "${D}" "${a}" ; then
+               if grep -qs "${ed}" "${a}" ; then
                        vecho -ne '\n'
                        eqawarn "QA Notice: ${s} appears to contain PORTAGE_TMPDIR paths"
                        abort="yes"
@@ -702,7 +705,7 @@ install_qa_check() {
        fi
 
        # Portage regenerates this on the installed system.
-       rm -f "${D}"/usr/share/info/dir{,.gz,.bz2}
+       rm -f "${ed}"/usr/share/info/dir{,.gz,.bz2}
 
        if has multilib-strict ${FEATURES} && \
           [[ -x /usr/bin/file && -x /usr/bin/find ]] && \
@@ -711,15 +714,15 @@ install_qa_check() {
                local abort=no dir file firstrun=yes
                MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g')
                for dir in ${MULTILIB_STRICT_DIRS} ; do
-                       [[ -d ${D}/${dir} ]] || continue
-                       for file in $(find ${D}/${dir} -type f | grep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
+                       [[ -d ${ed}/${dir} ]] || continue
+                       for file in $(find ${ed}/${dir} -type f | grep -v "^${ed}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
                                if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then
                                        if [[ ${firstrun} == yes ]] ; then
                                                echo "Files matching a file type that is not allowed:"
                                                firstrun=no
                                        fi
                                        abort=yes
-                                       echo "   ${file#${D}//}"
+                                       echo "   ${file#${ed}//}"
                                fi
                        done
                done
@@ -728,7 +731,7 @@ install_qa_check() {
 
        # ensure packages don't install systemd units automagically
        if ! has systemd ${INHERITED} && \
-               [[ -d "${D}"/lib/systemd/system ]]
+               [[ -d "${ed}"/lib/systemd/system ]]
        then
                eqawarn "QA Notice: package installs systemd unit files (/lib/systemd/system)"
                eqawarn "           but does not inherit systemd.eclass."
@@ -886,6 +889,9 @@ preinst_mask() {
                 return 1
        fi
 
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
+
        # Make sure $PWD is not ${D} so that we don't leave gmon.out files
        # in there in case any tools were built with -pg in CFLAGS.
        cd "${T}"
@@ -898,11 +904,11 @@ preinst_mask() {
                fi
        done
 
-       install_mask "${D}" "${INSTALL_MASK}"
+       install_mask "${ed}" "${INSTALL_MASK}"
 
        # remove share dir if unnessesary
        if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; then
-               rmdir "${D}usr/share" &> /dev/null
+               rmdir "${ed}usr/share" &> /dev/null
        fi
 }
 
@@ -911,29 +917,33 @@ preinst_sfperms() {
                 eerror "${FUNCNAME}: D is unset"
                 return 1
        fi
+
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
+
        # Smart FileSystem Permissions
        if has sfperms $FEATURES; then
                local i
-               find "${D}" -type f -perm -4000 -print0 | \
+               find "${ed}" -type f -perm -4000 -print0 | \
                while read -r -d $'\0' i ; do
                        if [ -n "$(find "$i" -perm -2000)" ] ; then
-                               ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${D}}"
+                               ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${ed}}"
                                chmod o-r "$i"
                                eend $?
                        else
-                               ebegin ">>> SetUID: [chmod go-r] /${i#${D}}"
+                               ebegin ">>> SetUID: [chmod go-r] /${i#${ed}}"
                                chmod go-r "$i"
                                eend $?
                        fi
                done
-               find "${D}" -type f -perm -2000 -print0 | \
+               find "${ed}" -type f -perm -2000 -print0 | \
                while read -r -d $'\0' i ; do
                        if [ -n "$(find "$i" -perm -4000)" ] ; then
                                # This case is already handled
                                # by the SetUID check above.
                                true
                        else
-                               ebegin ">>> SetGID: [chmod o-r] /${i#${D}}"
+                               ebegin ">>> SetGID: [chmod o-r] /${i#${ed}}"
                                chmod o-r "$i"
                                eend $?
                        fi
@@ -946,6 +956,10 @@ preinst_suid_scan() {
                 eerror "${FUNCNAME}: D is unset"
                 return 1
        fi
+
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
+
        # total suid control.
        if has suidctl $FEATURES; then
                local i sfconf x
@@ -954,10 +968,10 @@ preinst_suid_scan() {
                # to files outside of the sandbox, but this
                # can easly be bypassed using the addwrite() function
                addwrite "${sfconf}"
-               vecho ">>> Performing suid scan in ${D}"
-               for i in $(find "${D}" -type f \( -perm -4000 -o -perm -2000 \) ); do
+               vecho ">>> Performing suid scan in ${ed}"
+               for i in $(find "${ed}" -type f \( -perm -4000 -o -perm -2000 \) ); do
                        if [ -s "${sfconf}" ]; then
-                               install_path=/${i#${D}}
+                               install_path=/${i#${ed}}
                                if grep -q "^${install_path}\$" "${sfconf}" ; then
                                        vecho "- ${install_path} is an approved suid file"
                                else
@@ -967,7 +981,7 @@ preinst_suid_scan() {
                                        chmod ugo-s "${i}"
                                        grep "^#${install_path}$" "${sfconf}" > /dev/null || {
                                                vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
-                                               echo "## ${ls_ret%${D}*}${install_path}" >> "${sfconf}"
+                                               echo "## ${ls_ret%${ed}*}${install_path}" >> "${sfconf}"
                                                echo "#${install_path}" >> "${sfconf}"
                                                # no delwrite() eh?
                                                # delwrite ${sconf}
@@ -1008,10 +1022,14 @@ preinst_selinux_labels() {
 }
 
 dyn_package() {
+
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
+
        # Make sure $PWD is not ${D} so that we don't leave gmon.out files
        # in there in case any tools were built with -pg in CFLAGS.
        cd "${T}"
-       install_mask "${PORTAGE_BUILDDIR}/image" "${PKG_INSTALL_MASK}"
+       install_mask "${ed}" "${PKG_INSTALL_MASK}"
        local tar_options=""
        [[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v"
        # Sandbox is disabled in case the user wants to use a symlink
@@ -1085,10 +1103,14 @@ __END1__
 }
 
 dyn_rpm() {
+
+       local eprefix=${EPREFIX}
+       case "$EAPI" in 0|1|2) eprefix= ;; esac
+
        cd "${T}" || die "cd failed"
        local machine_name=$(uname -m)
-       local dest_dir=/usr/src/rpm/RPMS/${machine_name}
-       addwrite /usr/src/rpm
+       local dest_dir=${eprefix}/usr/src/rpm/RPMS/${machine_name}
+       addwrite ${eprefix}/usr/src/rpm
        addwrite "${RPMDIR}"
        dyn_spec
        rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"
index 164b309e8381ed3af85b28d74d790674224a0b3b..9dcbf76f8376b79ab53b39c77f8f0ea2f172da1d 100644 (file)
@@ -498,8 +498,13 @@ dyn_install() {
        fi
        trap "abort_install" SIGINT SIGQUIT
        ebuild_phase pre_src_install
-       rm -rf "${PORTAGE_BUILDDIR}/image"
-       mkdir "${PORTAGE_BUILDDIR}/image"
+
+       _x=${ED}
+       case "$EAPI" in 0|1|2) _x=${D} ;; esac
+       rm -rf "${D}"
+       mkdir -p "${_x}"
+       unset _x
+
        if [[ -d $S ]] ; then
                cd "${S}"
        elif has $EAPI 0 1 2 3 3_pre2 ; then
index a033fa8374186ee19fde288975e1528155197557..8a2f381c319af5869bbd92f6e3f51c6563f29590 100644 (file)
@@ -19,8 +19,10 @@ into() {
                export DESTTREE=""
        else
                export DESTTREE=$1
-               if [ ! -d "${D}${DESTTREE}" ]; then
-                       install -d "${D}${DESTTREE}"
+               local ed=${ED}
+               case "$EAPI" in 0|1|2) ed=${D} ;; esac
+               if [ ! -d "${ed}${DESTTREE}" ]; then
+                       install -d "${ed}${DESTTREE}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
                                helpers_die "${FUNCNAME[0]} failed"
@@ -35,8 +37,10 @@ insinto() {
                export INSDESTTREE=""
        else
                export INSDESTTREE=$1
-               if [ ! -d "${D}${INSDESTTREE}" ]; then
-                       install -d "${D}${INSDESTTREE}"
+               local ed=${ED}
+               case "$EAPI" in 0|1|2) ed=${D} ;; esac
+               if [ ! -d "${ed}${INSDESTTREE}" ]; then
+                       install -d "${ed}${INSDESTTREE}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
                                helpers_die "${FUNCNAME[0]} failed"
@@ -51,8 +55,10 @@ exeinto() {
                export _E_EXEDESTTREE_=""
        else
                export _E_EXEDESTTREE_="$1"
-               if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
-                       install -d "${D}${_E_EXEDESTTREE_}"
+               local ed=${ED}
+               case "$EAPI" in 0|1|2) ed=${D} ;; esac
+               if [ ! -d "${ed}${_E_EXEDESTTREE_}" ]; then
+                       install -d "${ed}${_E_EXEDESTTREE_}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
                                helpers_die "${FUNCNAME[0]} failed"
@@ -67,8 +73,10 @@ docinto() {
                export _E_DOCDESTTREE_=""
        else
                export _E_DOCDESTTREE_="$1"
-               if [ ! -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
-                       install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+               local ed=${ED}
+               case "$EAPI" in 0|1|2) ed=${D} ;; esac
+               if [ ! -d "${ed}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
+                       install -d "${ed}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
                                helpers_die "${FUNCNAME[0]} failed"
@@ -133,9 +141,11 @@ docompress() {
 keepdir() {
        dodir "$@"
        local x
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
        if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
                shift
-               find "$@" -type d -printf "${D}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
+               find "$@" -type d -printf "${ed}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \
                        | tr "\n" "\0" | \
                        while read -r -d $'\0' ; do
                                >> "$REPLY" || \
@@ -143,8 +153,8 @@ keepdir() {
                        done
        else
                for x in "$@"; do
-                       >> "${D}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
-                               die "Failed to create .keep in ${D}${x}"
+                       >> "${ed}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
+                               die "Failed to create .keep in ${ed}${x}"
                done
        fi
 }
@@ -369,6 +379,9 @@ unpack() {
 econf() {
        local x
 
+       local eprefix=${EPREFIX}
+       case "$EAPI" in 0|1|2) eprefix= ;; esac
+
        _hasg() {
                local x s=$1
                shift
@@ -398,12 +411,12 @@ econf() {
                        sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
                                die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
                fi
-               if [ -e /usr/share/gnuconfig/ ]; then
+               if [ -e "${eprefix}"/usr/share/gnuconfig/ ]; then
                        find "${WORKDIR}" -type f '(' \
                        -name config.guess -o -name config.sub ')' -print0 | \
                        while read -r -d $'\0' x ; do
-                               vecho " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}"
-                               cp -f /usr/share/gnuconfig/"${x##*/}" "${x}"
+                               vecho " * econf: updating ${x/${WORKDIR}\/} with ${eprefix}/usr/share/gnuconfig/${x##*/}"
+                               cp -f "${eprefix}"/usr/share/gnuconfig/"${x##*/}" "${x}"
                        done
                fi
 
@@ -423,7 +436,7 @@ econf() {
                if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
                        export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
                        [[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
-                       : ${CONF_PREFIX:=/usr}
+                       : ${CONF_PREFIX:=${eprefix}/usr}
                        CONF_PREFIX=${CONF_PREFIX#*=}
                        [[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
                        [[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
@@ -431,15 +444,15 @@ econf() {
                fi
 
                set -- \
-                       --prefix=/usr \
+                       --prefix="${eprefix}"/usr \
                        ${CBUILD:+--build=${CBUILD}} \
                        --host=${CHOST} \
                        ${CTARGET:+--target=${CTARGET}} \
-                       --mandir=/usr/share/man \
-                       --infodir=/usr/share/info \
-                       --datadir=/usr/share \
-                       --sysconfdir=/etc \
-                       --localstatedir=/var/lib \
+                       --mandir="${eprefix}"/usr/share/man \
+                       --infodir="${eprefix}"/usr/share/info \
+                       --datadir="${eprefix}"/usr/share \
+                       --sysconfdir="${eprefix}"/etc \
+                       --localstatedir="${eprefix}"/var/lib \
                        "$@" \
                        ${EXTRA_ECONF}
                vecho "${ECONF_SOURCE}/configure" "$@"
@@ -463,6 +476,8 @@ econf() {
 einstall() {
        # CONF_PREFIX is only set if they didn't pass in libdir above.
        local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
+       local ed=${ED}
+       case "$EAPI" in 0|1|2) ed=${D} ;; esac
        LIBDIR_VAR="LIBDIR_${ABI}"
        if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
                CONF_LIBDIR="${!LIBDIR_VAR}"
@@ -477,22 +492,22 @@ einstall() {
 
        if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
                if [ "${PORTAGE_DEBUG}" == "1" ]; then
-                       ${MAKE:-make} -n prefix="${D}usr" \
-                               datadir="${D}usr/share" \
-                               infodir="${D}usr/share/info" \
-                               localstatedir="${D}var/lib" \
-                               mandir="${D}usr/share/man" \
-                               sysconfdir="${D}etc" \
+                       ${MAKE:-make} -n prefix="${ed}usr" \
+                               datadir="${ed}usr/share" \
+                               infodir="${ed}usr/share/info" \
+                               localstatedir="${ed}var/lib" \
+                               mandir="${ed}usr/share/man" \
+                               sysconfdir="${ed}etc" \
                                ${LOCAL_EXTRA_EINSTALL} \
                                ${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
                                "$@" install
                fi
-               ${MAKE:-make} prefix="${D}usr" \
-                       datadir="${D}usr/share" \
-                       infodir="${D}usr/share/info" \
-                       localstatedir="${D}var/lib" \
-                       mandir="${D}usr/share/man" \
-                       sysconfdir="${D}etc" \
+               ${MAKE:-make} prefix="${ed}usr" \
+                       datadir="${ed}usr/share" \
+                       infodir="${ed}usr/share/info" \
+                       localstatedir="${ed}var/lib" \
+                       mandir="${ed}usr/share/man" \
+                       sysconfdir="${ed}etc" \
                        ${LOCAL_EXTRA_EINSTALL} \
                        ${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
                        "$@" install || die "einstall failed"
index 7ed679d62943123a042f7dfbb900c2764a73e2d6..d108959cad99409bd9f79681a1b5a948fc1b63a5 100644 (file)
@@ -36,11 +36,10 @@ pkg_pretend() {
 
 src_install() {
        einfo "installing something..."
-       # TODO: Add prefix support to shell code/helpers, so we
-       #       can use things like dodir and doins here.
-       mkdir -p "${ED}"/usr/lib/${P} || die
-       echo "blah blah blah" > "${ED}"/usr/lib/${P}/regular-file || die
-       ln -s regular-file "${ED}"/usr/lib/${P}/symlink || die
+       insinto /usr/lib/${P}
+       echo "blah blah blah" > "${T}"/regular-file
+       doins "${T}"/regular-file
+       dosym regular-file /usr/lib/${P}/symlink || die
 
        # Test code for bug #381629, using a copyright symbol encoded with latin-1.
        # We use $(printf "\\xa9") rather than $'\\xa9', since printf apparently
@@ -48,10 +47,11 @@ src_install() {
        # some conditions. TODO: Find out why it transforms to \\xef\\xbf\\xbd when
        # running tests for Python 3.2 (even though it's bash that is ultimately
        # responsible for performing the transformation).
-       local latin_1_dir=${ED}/usr/lib/${P}/latin-1-$(printf "\\xa9")-directory
-       mkdir "${latin_1_dir}"
-       echo "blah blah blah" > ${latin_1_dir}/latin-1-$(printf "\\xa9")-regular-file || die
-       ln -s latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die
+       local latin_1_dir=/usr/lib/${P}/latin-1-$(printf "\\xa9")-directory
+       insinto "${latin_1_dir}"
+       echo "blah blah blah" > "${T}"/latin-1-$(printf "\\xa9")-regular-file || die
+       doins "${T}"/latin-1-$(printf "\\xa9")-regular-file
+       dosym latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die
 }
 
 pkg_config() {
@@ -80,6 +80,11 @@ pkg_info() {
                                "LICENSE": "GPL-2",
                                "MISC_CONTENT": install_something,
                        },
+                       "virtual/foo-0": {
+                               "EAPI" : "4",
+                               "KEYWORDS": "x86",
+                               "LICENSE": "GPL-2",
+                       },
                }
 
                installed = {
@@ -201,6 +206,7 @@ pkg_info() {
                                emerge_cmd + ("--metadata",),
                        emerge_cmd + ("--metadata",),
                        rm_cmd + ("-rf", cachedir),
+                       emerge_cmd + ("--oneshot", "virtual/foo"),
                        emerge_cmd + ("--pretend", "dev-libs/A"),
                        ebuild_cmd + (test_ebuild, "manifest", "clean", "package", "merge"),
                        emerge_cmd + ("--pretend", "--tree", "--complete-graph", "dev-libs/A"),