From: Fabian Groffen Date: Tue, 24 Aug 2010 19:51:31 +0000 (+0200) Subject: Merge remote branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=dac64477739ea7d495d65157ec8a55fa38ce45ad;p=portage.git Merge remote branch 'overlays-gentoo-org/master' into prefix 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 --- dac64477739ea7d495d65157ec8a55fa38ce45ad diff --cc bin/ebuild index cf48a7b79,9ce058b5c..a00e5ed7d --- a/bin/ebuild +++ b/bin/ebuild @@@ -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 diff --cc bin/ebuild-helpers/dobin index 0b25b25a3,e385455d7..e158a7176 --- a/bin/ebuild-helpers/dobin +++ b/bin/ebuild-helpers/dobin @@@ -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 diff --cc bin/ebuild-helpers/doconfd index 004d019cc,e14600022..7fe864822 --- a/bin/ebuild-helpers/doconfd +++ b/bin/ebuild-helpers/doconfd @@@ -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 diff --cc bin/ebuild-helpers/dodir index 0327813b9,f40bee7e4..7da507aee --- a/bin/ebuild-helpers/dodir +++ b/bin/ebuild-helpers/dodir @@@ -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 diff --cc bin/ebuild-helpers/dodoc index f67d283c1,29b690112..10aa5a63e --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@@ -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" diff --cc bin/ebuild-helpers/doenvd index aea059a30,28ab5d234..561e67df0 --- a/bin/ebuild-helpers/doenvd +++ b/bin/ebuild-helpers/doenvd @@@ -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 diff --cc bin/ebuild-helpers/doexe index c293784ef,360800e02..4f4040283 --- a/bin/ebuild-helpers/doexe +++ b/bin/ebuild-helpers/doexe @@@ -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 diff --cc bin/ebuild-helpers/dohtml index 743ce6f0a,630629a4b..b5c73e30a --- a/bin/ebuild-helpers/dohtml +++ b/bin/ebuild-helpers/dohtml @@@ -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 diff --cc bin/ebuild-helpers/doinfo index 1cf738d88,54fb8dac2..3cfbe6f32 --- a/bin/ebuild-helpers/doinfo +++ b/bin/ebuild-helpers/doinfo @@@ -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 diff --cc bin/ebuild-helpers/doinitd index fbfc63661,b711e190a..ff5255aa2 --- a/bin/ebuild-helpers/doinitd +++ b/bin/ebuild-helpers/doinitd @@@ -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 diff --cc bin/ebuild-helpers/doins index f18e7ebf2,bbc4e97b6..4a2b08279 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@@ -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 diff --cc bin/ebuild-helpers/dolib index 3ff7973c4,87ade425a..53805ea30 --- a/bin/ebuild-helpers/dolib +++ b/bin/ebuild-helpers/dolib @@@ -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 diff --cc bin/ebuild-helpers/doman index 90fce11ef,1862f83e1..f64a91cdb --- a/bin/ebuild-helpers/doman +++ b/bin/ebuild-helpers/doman @@@ -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 diff --cc bin/ebuild-helpers/domo index a88b8d79d,4737f44e1..f8a7bb94a --- a/bin/ebuild-helpers/domo +++ b/bin/ebuild-helpers/domo @@@ -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 diff --cc bin/ebuild-helpers/dosbin index a9a0401fd,87a30914a..d1400f44e --- a/bin/ebuild-helpers/dosbin +++ b/bin/ebuild-helpers/dosbin @@@ -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 diff --cc bin/ebuild-helpers/dosym index ce4b84c57,500dad094..bd4044f63 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@@ -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 diff --cc bin/ebuild-helpers/ecompress index ab952c16d,ef01cd4e0..feb8995ff --- a/bin/ebuild-helpers/ecompress +++ b/bin/ebuild-helpers/ecompress @@@ -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" diff --cc bin/ebuild-helpers/ecompressdir index 7608202f3,6cbb53f9a..9bcdd9342 --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@@ -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) diff --cc bin/ebuild-helpers/emake index 1b47c041c,d842781a7..197e0dabb --- a/bin/ebuild-helpers/emake +++ b/bin/ebuild-helpers/emake @@@ -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 diff --cc bin/ebuild-helpers/fowners index 962f66c80,4cc6bfacc..b9491649f --- a/bin/ebuild-helpers/fowners +++ b/bin/ebuild-helpers/fowners @@@ -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 diff --cc bin/ebuild-helpers/fperms index 322809038,0260bdc47..dec0b4294 --- a/bin/ebuild-helpers/fperms +++ b/bin/ebuild-helpers/fperms @@@ -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 diff --cc bin/ebuild-helpers/newbin index eee0d8e3c,30f19b062..bf5def80c --- a/bin/ebuild-helpers/newbin +++ b/bin/ebuild-helpers/newbin @@@ -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 diff --cc bin/ebuild-helpers/newconfd index cc5a1f50f,5752cfa7b..284de9737 --- a/bin/ebuild-helpers/newconfd +++ b/bin/ebuild-helpers/newconfd @@@ -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 diff --cc bin/ebuild-helpers/newdoc index 260e1b6b3,f97ce0d67..0ca1e52b2 --- a/bin/ebuild-helpers/newdoc +++ b/bin/ebuild-helpers/newdoc @@@ -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 diff --cc bin/ebuild-helpers/newenvd index 1d79fd790,83c556e7e..02ad10eb1 --- a/bin/ebuild-helpers/newenvd +++ b/bin/ebuild-helpers/newenvd @@@ -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 diff --cc bin/ebuild-helpers/newexe index cdf5258ef,92dbe9f07..0877d201a --- a/bin/ebuild-helpers/newexe +++ b/bin/ebuild-helpers/newexe @@@ -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 diff --cc bin/ebuild-helpers/newinitd index 39395c9dd,fc6003ac2..aa7955c63 --- a/bin/ebuild-helpers/newinitd +++ b/bin/ebuild-helpers/newinitd @@@ -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 diff --cc bin/ebuild-helpers/newins index 21f02e067,9da212fb5..a2326bb08 --- a/bin/ebuild-helpers/newins +++ b/bin/ebuild-helpers/newins @@@ -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 diff --cc bin/ebuild-helpers/newlib.a index 317e36022,eef4104be..d14ea0ef1 --- a/bin/ebuild-helpers/newlib.a +++ b/bin/ebuild-helpers/newlib.a @@@ -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 diff --cc bin/ebuild-helpers/newlib.so index d257fc692,c8696f330..3349900ff --- a/bin/ebuild-helpers/newlib.so +++ b/bin/ebuild-helpers/newlib.so @@@ -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 diff --cc bin/ebuild-helpers/newman index 9e44f72de,ffb8a2de1..d15abc04c --- a/bin/ebuild-helpers/newman +++ b/bin/ebuild-helpers/newman @@@ -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 diff --cc bin/ebuild-helpers/newsbin index f499a278b,82242aa95..f8e79df82 --- a/bin/ebuild-helpers/newsbin +++ b/bin/ebuild-helpers/newsbin @@@ -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 diff --cc bin/ebuild.sh index 3e9b76730,84a83fe40..3a7981338 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@@ -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/misc-functions.sh index 922098fee,123edc0ec..11c26bf64 mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -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 54826ad56,df4232516..b52532456 --- a/bin/repoman +++ b/bin/repoman @@@ -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 pym/_emerge/Binpkg.py index b4ccfb28f,2201decaf..0482e1824 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@@ -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): @@@ -263,23 -241,17 +250,34 @@@ 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 diff --cc pym/_emerge/actions.py index af1c41400,eb8df9cd3..4a501f416 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@@ -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 diff --cc pym/_emerge/depgraph.py index f81d4924e,f9b581e0e..f032f2a18 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@@ -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")) diff --cc pym/portage/package/ebuild/config.py index a1791d7bd,6e20b1cb7..4aa449750 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@@ -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 diff --cc pym/portage/package/ebuild/prepare_build_dirs.py index 129dad4ce,25e5beb6e..2d04d7d41 --- a/pym/portage/package/ebuild/prepare_build_dirs.py +++ b/pym/portage/package/ebuild/prepare_build_dirs.py @@@ -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