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
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
-#!/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
-#!/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
-#!/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
-#!/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"
-#!/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
-#!/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
# 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
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
-#!/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
-#!/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"
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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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"
-#!/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"
--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)
# 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
(
) >&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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
-#!/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
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
}
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
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
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
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"
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,
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
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
__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
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
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"))
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
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