Merge remote branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Tue, 24 Aug 2010 19:51:31 +0000 (21:51 +0200)
committerFabian Groffen <grobian@gentoo.org>
Tue, 24 Aug 2010 19:51:31 +0000 (21:51 +0200)
This commit breaks Prefix completely.

It is just a merge of the changes made in master which are wrong
regarding Prefix.  As a result, the code here is now incorrect with lots
of double prefixes.

I hope I can fix the problems after this commit without missing a spot
so I won't break Prefix Portage.

Conflicts:
bin/ebuild-helpers/dobin
bin/ebuild-helpers/doconfd
bin/ebuild-helpers/dodir
bin/ebuild-helpers/dodoc
bin/ebuild-helpers/doenvd
bin/ebuild-helpers/doexe
bin/ebuild-helpers/doinfo
bin/ebuild-helpers/doinitd
bin/ebuild-helpers/doins
bin/ebuild-helpers/dolib
bin/ebuild-helpers/doman
bin/ebuild-helpers/domo
bin/ebuild-helpers/dosbin
bin/ebuild-helpers/dosym
bin/ebuild-helpers/ecompress
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/fowners
bin/ebuild-helpers/fperms
bin/ebuild-helpers/newbin
bin/ebuild-helpers/newconfd
bin/ebuild-helpers/newdoc
bin/ebuild-helpers/newenvd
bin/ebuild-helpers/newexe
bin/ebuild-helpers/newinitd
bin/ebuild-helpers/newins
bin/ebuild-helpers/newlib.a
bin/ebuild-helpers/newlib.so
bin/ebuild-helpers/newman
bin/ebuild-helpers/newsbin
bin/misc-functions.sh
pym/_emerge/Binpkg.py
pym/_emerge/actions.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py

51 files changed:
1  2 
bin/ebuild
bin/ebuild-helpers/dobin
bin/ebuild-helpers/doconfd
bin/ebuild-helpers/dodir
bin/ebuild-helpers/dodoc
bin/ebuild-helpers/doenvd
bin/ebuild-helpers/doexe
bin/ebuild-helpers/dohtml
bin/ebuild-helpers/doinfo
bin/ebuild-helpers/doinitd
bin/ebuild-helpers/doins
bin/ebuild-helpers/dolib
bin/ebuild-helpers/doman
bin/ebuild-helpers/domo
bin/ebuild-helpers/dosbin
bin/ebuild-helpers/dosym
bin/ebuild-helpers/ecompress
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/emake
bin/ebuild-helpers/fowners
bin/ebuild-helpers/fperms
bin/ebuild-helpers/newbin
bin/ebuild-helpers/newconfd
bin/ebuild-helpers/newdoc
bin/ebuild-helpers/newenvd
bin/ebuild-helpers/newexe
bin/ebuild-helpers/newinitd
bin/ebuild-helpers/newins
bin/ebuild-helpers/newlib.a
bin/ebuild-helpers/newlib.so
bin/ebuild-helpers/newman
bin/ebuild-helpers/newsbin
bin/ebuild-ipc.py
bin/ebuild.sh
bin/egencache
bin/misc-functions.sh
bin/repoman
man/emerge.1
pym/_emerge/Binpkg.py
pym/_emerge/EbuildBuild.py
pym/_emerge/Package.py
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/const.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py
pym/portage/package/ebuild/prepare_build_dirs.py
pym/portage/util/__init__.py
pym/portage/util/env_update.py

diff --cc bin/ebuild
index cf48a7b79d7279b56d669d448b5db40350778cdf,9ce058b5cb8e2985eb47acdf7399dbcf3abd5999..a00e5ed7d7bf008cdefeb923ad36265c6b07067f
@@@ -62,15 -62,14 +62,16 @@@ if "merge" in pargs
        os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
  
  os.environ["PORTAGE_CALLER"]="ebuild"
 -try:
 -      import portage
 -except ImportError:
 -      from os import path as osp
 -      sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 -      import portage
 +# for an explanation on this logic, see pym/_emerge/__init__.py
 +from os import environ as ose
 +from os import path as osp
 +if ose.__contains__("PORTAGE_PYTHONPATH"):
 +    sys.path.insert(0, ose["PORTAGE_PYTHONPATH"])
 +else:
 +    sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.                    realpath(__file__))), "pym"))
 +import portage
  
+ portage.dep._internal_warnings = True
  from portage import os
  from portage import _encodings
  from portage import _shell_quote
index 0b25b25a31fe907c3c644a5195b4699177add10b,e385455d7d2fd80d6c0d9082449e6bd719ace335..e158a71768f074192df660be990dafb703f1e2da
@@@ -1,23 -1,23 +1,23 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -lt 1 ]] ; then
-       helpers_die "$0: at least one argument needed"
+       helpers_die "${0##*/}: at least one argument needed"
        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; }
 +if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
-       install -d "${ED}${DESTTREE}/bin" || { helpers_die "$0: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
++      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 -m 0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/bin"
 -              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 004d019cc7d0aa95f65697975dcf0ed289e0208e,e146000227eefafb34e86bdb3709bcac2cbe4587..7fe864822af3766dc9779d2d90f19733fcdf6df8
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  if [[ $# -lt 1 ]] ; then
index 0327813b9f24cfb2dccde3b846ab2360f4975017,f40bee7e48f6db5395d0717d8db67fc8a76e7dcf..7da507aee79a397665c4e02e527dc98ca6c7b491
@@@ -1,10 -1,10 +1,10 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
 -install -d ${DIROPTIONS} "${@/#/${D}/}"
 +install -d ${DIROPTIONS} "${@/#/${ED}/}"
  ret=$?
- [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index f67d283c1fb99a7df74aa5afeef12c1b735b04fe,29b69011260dc7c376857913b8db6b8d0008eb95..10aa5a63eccb0482d81eae5c2ec3c470c630ff47
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [ $# -lt 1 ] ; then
        helpers_die "${0##*/}: at least one argument needed"
index aea059a30e7e6f6d106b562dcbe7da9d2114aa2e,28ab5d23438a0887180554bdb0cd77dfcfd8b9e5..561e67df0809bb1169419cf503b1f04febf06327
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  if [[ $# -lt 1 ]] ; then
index c293784ef0625cd048f6203fad749d9351b56a55,360800e02e5ea0cb5a35700c9fdc1743dd91372c..4f4040283c1e8fcd52acc0babfa574d128715481
@@@ -1,11 -1,11 +1,11 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -lt 1 ]] ; then
-       helpers_die "$0: at least one argument needed"
+       helpers_die "${0##*/}: at least one argument needed"
        exit 1
  fi
  
index 743ce6f0a5b424bbde6786e3021c543280fa6d18,630629a4bf7b20f9f4f133d9b6635548561d91cd..b5c73e30a22347f2f9f981809ae627bfb744e26f
@@@ -2,13 -2,13 +2,13 @@@
  # Copyright 2009-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
 +PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}
 +PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}
  PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
 -      "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
 +      "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
  
  ret=$?
- [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index 1cf738d884225952f73a2556cf60367919ac3564,54fb8dac2ead471904fd93eed326bd537b2b4f16..3cfbe6f325e9cc5363414893e53daf9001441358
@@@ -9,11 -9,11 +9,11 @@@ if [[ -z $1 ]] ; the
        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; }
 +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; }
++      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 fbfc636614da4d0f40f0a2b184a5b70489623a5c,b711e190a67175e75de85cdbdb66017fa611f680..ff5255aa25ba4b9cfc02ef10478b305951cb0279
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  if [[ $# -lt 1 ]] ; then
index f18e7ebf289f6985b6053b7e086a1d1954a922b1,bbc4e97b6b3a3e8ae8c58440b88a8266e653bb5c..4a2b08279c8eb9dc63fc8a766b914a248ff1f93a
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2009 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [ $# -lt 1 ] ; then
        helpers_die "${0##*/}: at least one argument needed"
@@@ -18,10 -18,10 +18,10 @@@ f
  
  if [[ ${INSDESTTREE#${D}} != "${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}"
        exit 1
  fi
  
index 3ff7973c4b75eafd5897c7e73a7f875b547dcc1f,87ade425aa9e17a121ce6cb9195fd99d5d77f217..53805ea304c08b4e55d73e2b1d7e3c4dcaaa2ed6
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 90fce11efbc6b25aca11643dbb4a891544be2d58,1862f83e1d51f37160372603d503a36ce8d776c4..f64a91cdba53e62469a7003b21c957a050f6640b
@@@ -1,11 -1,11 +1,11 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -lt 1 ]] ; then
-       helpers_die "$0: at least one argument needed"
+       helpers_die "${0##*/}: at least one argument needed"
        exit 1
  fi
  
index a88b8d79d993ce6d0f910c96f6b8bfefd96a5c65,4737f44e10e7ba5a0506847d21a76fc50cf82c05..f8a7bb94aa2c60532df179895f4f95e69379641d
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index a9a0401fd3bb2a7f3dd2eb1402448641134531a1,87a30914afd472bb3706f0528d1356075555e041..d1400f44edc88336a197321d9df4b7c2bb354361
@@@ -1,16 -1,16 +1,16 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -lt 1 ]] ; then
-       helpers_die "$0: at least one argument needed"
+       helpers_die "${0##*/}: at least one argument needed"
        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; }
 +if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
-       install -d "${ED}${DESTTREE}/sbin" || { helpers_die "$0: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
++      install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
  fi
  
  ret=0
index ce4b84c57550ed3b2527ffa3fa814bb94d87d256,500dad0944ef20113c2fa93afa4f2498f57baf78..bd4044f632ca9a37a0bfccbecc38995e20ed4abf
@@@ -1,21 -1,18 +1,21 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -ne 2 ]] ; then
-       helpers_die "$0: two arguments needed"
+       helpers_die "${0##*/}: two arguments needed"
        exit 1
  fi
  
 -destdir=${2%/*}
 -[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
 +target="${1}"
 +linkname="${2}"
 +[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
 +destdir=${linkname%/*}
 +[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
  
 -ln -snf "$1" "${D}$2"
 +ln -snf "${target}" "${ED}/${linkname}"
  ret=$?
- [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index ab952c16d4a2c0f74ca4ead84a9811fa59b4cb4a,ef01cd4e0b97aa21a48c9a1a1ff1c121747af0da..feb8995ff8a4a9cd22c6a0b6fcabde135db6701f
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ -z $1 ]] ; then
        helpers_die "${0##*/}: at least one argument needed"
index 7608202f31558e6e2e907c10fc8ebca5f65b3519,6cbb53f9af624c7913e7bdcdf81e66f1025c0890..9bcdd934271151359991ba77688fc7ee3101fb26
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ -z $1 ]] ; then
        helpers_die "${0##*/}: at least one argument needed"
@@@ -20,10 -20,10 +20,10 @@@ case $1 i
        --queue)
                shift
                set -- "${@/%/.ecompress.dir}"
 -              set -- "${@/#/${D}}"
 +              set -- "${@/#/${ED}}"
                touch "$@"
                ret=$?
-               [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+               [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
                exit $?
                ;;
        --dequeue)
index 1b47c041ca46a3241d60185c70be7e5a99099b50,d842781a7bbe3bfe6899ffd7b3a6c6e64f5d49df..197e0dabba38191baf87d67c622434b1bcf5da7f
@@@ -6,11 -6,10 +6,10 @@@
  #        only parameter supplied is -jN, where N is a number of
  #        parallel processes that should be ideal for the running host
  #        (e.g. on a single-CPU machine, N=2).  The MAKEOPTS variable
- #        is set in /etc/make.globals.  We don't source
- #        /etc/make.globals here because emake is only called from an
- #        ebuild.
+ #        is set in make.globals. We don't source make.globals
+ #        here because emake is only called from an ebuild.
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $PORTAGE_QUIET != 1 ]] ; then
        (
@@@ -23,7 -22,7 +22,7 @@@
        ) >&2
  fi
  
 -${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
 +${MAKE:-make} SHELL="${BASH:-/bin/bash}" ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
  ret=$?
- [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index 962f66c8013f22df02e2f6d837c3904838e2da68,4cc6bfaccedef8d3f75ac1a2ef68f0ee382098e0..b9491649fa36eca26a7d07f323f08361232d0267
@@@ -1,13 -1,13 +1,13 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  # 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"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index 322809038afe3c0105f8741a925a2e6674f37601,0260bdc476248bde0596f5aa8f1cd777db51b510..dec0b4294b96cd206dfa211c4e720a7f4a48d06e
@@@ -1,13 -1,13 +1,13 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2007 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  # 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"
+ [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
  exit $ret
index eee0d8e3cefdaeb94038ee5f05f126cc6ad5b7ff,30f19b062a261931170d0cb52b2d68c007764129..bf5def80ca79acfb36e0824cafd64f2637e7ce23
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index cc5a1f50f7a320e7ec5f0ce70d9bc0881aada558,5752cfa7bdfa85b13afc4e9f9fbdc3ef8f133c26..284de97374931603fcfef3f59c844ccef6186ab4
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 260e1b6b3d9c2dc6338cd5b61b01504ce7ecb5a4,f97ce0d67d62925ae1941b6a6ef2e7b04d2d6a14..0ca1e52b250b1b61faa64262ef48cbf6a5f8162d
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 1d79fd790c73a3cf8f9717f76f13cf41eef86fbc,83c556e7e402b169a14af59879c1cdefc8537832..02ad10eb1e4e0c3ea0d4f4881ebd4052cb944de4
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index cdf5258ef3320d360b22509bf851052c4c9823ed,92dbe9f073c9da6782998abaa406fc97db8c2fc7..0877d201acd5b454f8d2a25277ade9fa0d74a303
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 39395c9ddd950719535ee3575e25d5815b3d39b8,fc6003ac2983effdf6cbbe3c7af3f3bf93615f38..aa7955c63b8ae6b4d2194223ea852a5867fcea0f
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 21f02e0670ef5baf79866ff1704abd2faec9c47b,9da212fb5ff2c58b5464bdbe481b976f5ab17839..a2326bb08f57bca6da432f11fc26bcc32aa6d212
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2009 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 317e360228e62608952d66b8841c69675fdf1cdd,eef4104bef4512785d55a2d6e9784808b98bb181..d14ea0ef11a0bc73856d59c65faae69efb073079
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index d257fc69226203333422137d0ef01702a73a4437,c8696f33012efcc300629dcc7789067545c88a2a..3349900ff97376f6b257c441be1bf480b585cce7
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index 9e44f72de715373e583f714c940fccca14cc06dc,ffb8a2de1d208e0140f96d242ce3cf6a2657e5af..d15abc04c3065e860c2e67c3219a9dca44511f91
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
index f499a278bc60dd93dcf71a5e0b62333e0f011fcb,82242aa955a5b2d6e0f310b30626229d0f38541b..f8e79df829ca01ff6e72a65e5a7934597128fa88
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
Simple merge
diff --cc bin/ebuild.sh
index 3e9b76730f6d5f34138108321a556f4144dcc538,84a83fe40f4ffb28612e6edc23aa7a57af5ef45f..3a798133835f6a740be5aec13ff76e37f1d72f03
@@@ -790,10 -780,9 +790,10 @@@ into() 
                        install -d "${D}${DESTTREE}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
-                               helpers_die "$0 failed"
+                               helpers_die "${FUNCNAME[0]} failed"
                                return $ret
                        fi
 +>>>>>>> overlays-gentoo-org/master
                fi
        fi
  }
@@@ -803,11 -792,11 +803,11 @@@ insinto() 
                export INSDESTTREE=""
        else
                export INSDESTTREE=$1
 -              if [ ! -d "${D}${INSDESTTREE}" ]; then
 -                      install -d "${D}${INSDESTTREE}"
 +              if [ ! -d "${ED}${INSDESTTREE}" ]; then
 +                      install -d "${ED}${INSDESTTREE}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
-                               helpers_die "$0 failed"
+                               helpers_die "${FUNCNAME[0]} failed"
                                return $ret
                        fi
                fi
@@@ -819,11 -808,11 +819,11 @@@ exeinto() 
                export _E_EXEDESTTREE_=""
        else
                export _E_EXEDESTTREE_="$1"
 -              if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
 -                      install -d "${D}${_E_EXEDESTTREE_}"
 +              if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
 +                      install -d "${ED}${_E_EXEDESTTREE_}"
                        local ret=$?
                        if [[ $ret -ne 0 ]] ; then
-                               helpers_die "$0 failed"
+                               helpers_die "${FUNCNAME[0]} failed"
                                return $ret
                        fi
                fi
@@@ -835,11 -824,11 +835,11 @@@ 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_}"
 +              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 "$0 failed"
+                               helpers_die "${FUNCNAME[0]} failed"
                                return $ret
                        fi
                fi
diff --cc bin/egencache
Simple merge
index 922098fee264020f65c2ee296238120e956e6a78,123edc0ecc4a72078d60acbad08e518346a1b2e4..11c26bf64b272194e2a0d8690c2fccaf158551cd
mode 100644,100755..100644
@@@ -14,7 -14,7 +14,7 @@@
  MISC_FUNCTIONS_ARGS="$@"
  shift $#
  
- source @PORTAGE_BASE@/bin/ebuild.sh
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}/ebuild.sh"
  
  install_symlink_html_docs() {
        cd "${D}" || die "cd failed"
@@@ -531,9 -489,11 +533,11 @@@ install_qa_check_misc() 
                                abort="yes"
                        fi
                done
+               local cat_cmd=cat
+               [[ $PORTAGE_LOG_FILE = *.gz ]] && cat_cmd=zcat
                [[ $reset_debug = 1 ]] && set -x
-               f=$(cat "${PORTAGE_LOG_FILE}" | \
+               f=$($cat_cmd "${PORTAGE_LOG_FILE}" | \
 -                      "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
 +                      "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
                if [[ -n ${f} ]] ; then
  
                        # In the future this will be a forced "die". In preparation,
diff --cc bin/repoman
index 54826ad56b686bceef55065098253e6d2952ab95,df4232516b0e217694106b968a3590aa6cfb28c8..b5253245688e1e74237588f934f08b8259e27866
@@@ -30,15 -30,14 +30,16 @@@ except ImportError
  from itertools import chain
  from stat import S_ISDIR
  
 -try:
 -      import portage
 -except ImportError:
 -      from os import path as osp
 -      sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 -      import portage
 +# for an explanation on this logic, see pym/_emerge/__init__.py
 +import os
 +import sys
 +if os.environ.__contains__("PORTAGE_PYTHONPATH"):
 +      sys.path.insert(0, os.environ["PORTAGE_PYTHONPATH"])
 +else:
 +      sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym"))
 +import portage
  portage._disable_legacy_globals()
+ portage.dep._internal_warnings = True
  
  try:
        import xml.etree.ElementTree
diff --cc man/emerge.1
Simple merge
index b4ccfb28f1c8c637f564ea23378bec378e462b04,2201decaffae672073ba6a956f154c8d13e69b65..0482e182483948d865770f0b510ff7e70912b6ff
@@@ -3,8 -3,8 +3,9 @@@
  
  from _emerge.EbuildPhase import EbuildPhase
  from _emerge.BinpkgFetcher import BinpkgFetcher
+ from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
  from _emerge.BinpkgExtractorAsync import BinpkgExtractorAsync
 +from _emerge.BinpkgChpathtoolAsync import BinpkgChpathtoolAsync
  from _emerge.CompositeTask import CompositeTask
  from _emerge.BinpkgVerifier import BinpkgVerifier
  from _emerge.EbuildMerge import EbuildMerge
@@@ -30,24 -23,12 +31,12 @@@ class Binpkg(CompositeTask)
        __slots__ = ("find_blockers",
                "ldpath_mtimes", "logger", "opts",
                "pkg", "pkg_count", "prefetcher", "settings", "world_atom") + \
 -              ("_bintree", "_build_dir", "_ebuild_path", "_fetched_pkg",
 -              "_image_dir", "_infloc", "_pkg_path", "_tree", "_verify")
 +              ("_buildprefix", "_bintree", "_build_dir", "_ebuild_path", "_fetched_pkg",
 +              "_image_dir", "_infloc", "_pkg_path", "_tree", "_verify", "_work_dir")
  
        def _writemsg_level(self, msg, level=0, noiselevel=0):
- 
-               if not self.background:
-                       portage.util.writemsg_level(msg,
-                               level=level, noiselevel=noiselevel)
- 
-               log_path = self.settings.get("PORTAGE_LOG_FILE")
-               if  log_path is not None:
-                       f = codecs.open(_unicode_encode(log_path,
-                               encoding=_encodings['fs'], errors='strict'),
-                               mode='a', encoding=_encodings['content'], errors='replace')
-                       try:
-                               f.write(msg)
-                       finally:
-                               f.close()
+               self.scheduler.output(msg, level=level, noiselevel=noiselevel,
+                       log_path=self.settings.get("PORTAGE_LOG_FILE"))
  
        def _start(self):
  
                finally:
                        f.close()
  
 +              # Retrieve the EPREFIX this package was built with
 +              self._buildprefix = pkg_xpak.getfile(_unicode_encode("EPREFIX",
 +                      encoding=_encodings['repo.content']))
 +              if not self._buildprefix:
 +                      self._buildprefix = ''
 +              else:
 +                      self._buildprefix = self._buildprefix.strip()
 +              # We want to install in "our" prefix, not the binary one
 +              self.settings["EPREFIX"] = EPREFIX
 +              f = codecs.open(_unicode_encode(os.path.join(infloc, 'EPREFIX'),
 +                      encoding=_encodings['fs'], errors='strict'),
 +                      mode='w', encoding=_encodings['content'], errors='strict')
 +              try:
 +                      f.write(EPREFIX + "\n")
 +              finally:
 +                      f.close()
 +
+               env_extractor = BinpkgEnvExtractor(background=self.background,
+                       scheduler=self.scheduler, settings=self.settings)
+ 
+               self._start_task(env_extractor, self._env_extractor_exit)
+ 
+       def _env_extractor_exit(self, env_extractor):
+               if self._default_exit(env_extractor) != os.EX_OK:
+                       self._unlock_builddir()
+                       self.wait()
+                       return
+ 
                # This gives bashrc users an opportunity to do various things
                # such as remove binary packages after they're installed.
                settings = self.settings
Simple merge
Simple merge
index af1c4140063a4d36452f9d9079994f1fe21a0470,eb8df9cd30b9e4f6e352c4388375a7d0193b2aa6..4a501f416a0ab10295f14ce07cf4787b64fd7832
@@@ -27,7 -27,7 +27,7 @@@ from portage import o
  from portage import digraph
  from portage import _unicode_decode, _unicode_encode
  from portage.cache.cache_errors import CacheError
- from portage.const import NEWS_LIB_PATH, EPREFIX
 -from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH
++from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH, EPREFIX
  from portage.dbapi.dep_expand import dep_expand
  from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
        red, yellow
index f81d4924eee4dde9478bb07d3a1199aad3438004,f9b581e0ecc70edfd4ce02f0b78ab8a806e119e3..f032f2a18c3191fae4df293f016a70d3199d4a48
@@@ -6068,14 -6103,8 +6103,14 @@@ def _get_masking_status(pkg, pkgsetting
                        else:
                                if not required_use_is_sat:
                                        msg = "violated use flag constraints: '%s'" % required_use
-                                       mreasons.append(msg)
+                                       mreasons.append(_MaskReason("REQUIRED_USE", "REQUIRED_USE violated"))
  
 +      if pkg.built and not pkg.installed:
 +              if not "EPREFIX" in pkg.metadata or not pkg.metadata["EPREFIX"]:
 +                      mreasons.append("missing EPREFIX")
 +              elif len(pkg.metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]):
 +                      mreasons.append("EPREFIX: '%s' too small" % pkg.metadata["EPREFIX"])
 +
        if not pkg.metadata["SLOT"]:
                mreasons.append(
                        _MaskReason("invalid", "SLOT: undefined"))
Simple merge
Simple merge
Simple merge
index a1791d7bdce6648d3a74e2c266ad43572e67c4bb,6e20b1cb7961864bf9c429d0293a6137f1119d89..4aa449750f5ef5f177ff5859f3173603b23c0462
@@@ -650,9 -793,11 +800,11 @@@ class config(object)
                        target_root = normalize_path(os.path.abspath(
                                target_root)).rstrip(os.path.sep) + os.path.sep
  
 -                      ensure_dirs(target_root)
 -                      check_var_directory("ROOT", target_root)
 +                      portage.util.ensure_dirs(target_root + EPREFIX_LSTRIP)
 +                      check_var_directory("EROOT", target_root + EPREFIX_LSTRIP)
  
+                       eroot = target_root.rstrip(os.sep) + eprefix + os.sep
+ 
                        # The expand_map is used for variable substitution
                        # in getconfig() calls, and the getconfig() calls
                        # update expand_map with the value of each variable
index 129dad4cef5195bad884774ba031d17da6614563,25e5beb6eacf213a96cccec6f763dc35a37e28c3..2d04d7d41f4806e03e5f108b87a2fed822e0d57c
@@@ -17,10 -17,17 +17,18 @@@ from portage.localization import 
  from portage.output import colorize
  from portage.util import apply_recursive_permissions, \
        apply_secpass_permissions, ensure_dirs, writemsg
 +from portage.const import EPREFIX
  
- def prepare_build_dirs(myroot, mysettings, cleanup):
+ def prepare_build_dirs(myroot=None, settings=None, cleanup=False):
+       """
+       The myroot parameter is ignored.
+       """
+       myroot = None
  
+       if settings is None:
+               raise TypeError("settings argument is required")
+ 
+       mysettings = settings
        clean_dirs = [mysettings["HOME"]]
  
        # We enable cleanup when we want to make sure old cruft (such as the old
Simple merge
Simple merge