From: Fabian Groffen Date: Wed, 26 Sep 2012 18:24:34 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=596938085a7f715f2dbe44720f42d213b281b50c;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/ebuild-helpers/doconfd bin/ebuild-helpers/doenvd bin/ebuild-helpers/doinitd bin/isolated-functions.sh bin/misc-functions.sh cnf/make.globals pym/portage/dbapi/bintree.py pym/portage/dbapi/vartree.py --- 596938085a7f715f2dbe44720f42d213b281b50c diff --cc bin/ebuild-helpers/dobin index 922e600c7,06ae0c779..3d81c2d28 --- a/bin/ebuild-helpers/dobin +++ b/bin/ebuild-helpers/dobin @@@ -2,10 -2,10 +2,10 @@@ # 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 +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/doconfd index 42f3e429f,a3c09a50e..d0d3901ec --- a/bin/ebuild-helpers/doconfd +++ b/bin/ebuild-helpers/doconfd @@@ -3,8 -3,8 +3,8 @@@ # Distributed under the terms of the GNU General Public License v2 if [[ $# -lt 1 ]] ; then - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh + source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - helpers_die "${0##*/}: at least one argument needed" + __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --cc bin/ebuild-helpers/dodoc index 4b9c8b95f,2b0533feb..7f5e364a4 --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@@ -13,10 -13,10 +13,10 @@@ case "${EAPI}" i ;; esac -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/doenvd index 31c57d55a,9287933a9..c4fae0437 --- a/bin/ebuild-helpers/doenvd +++ b/bin/ebuild-helpers/doenvd @@@ -3,8 -3,8 +3,8 @@@ # Distributed under the terms of the GNU General Public License v2 if [[ $# -lt 1 ]] ; then - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh + source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - helpers_die "${0##*/}: at least one argument needed" + __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --cc bin/ebuild-helpers/doexe index 05a8759f9,efbf638fc..9c845ca0e --- a/bin/ebuild-helpers/doexe +++ b/bin/ebuild-helpers/doexe @@@ -2,10 -2,10 +2,10 @@@ # 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 +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 b3a3c7a1e,aec5e79bd..4f102b085 --- 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:-@PREFIX_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 4597b2ef0,e4ccc90d9..db49bedce --- a/bin/ebuild-helpers/doinfo +++ b/bin/ebuild-helpers/doinfo @@@ -2,10 -2,10 +2,10 @@@ # 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 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ -z $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/doinitd index 9eefa5209,476b858f6..8e99fa888 --- a/bin/ebuild-helpers/doinitd +++ b/bin/ebuild-helpers/doinitd @@@ -3,8 -3,8 +3,8 @@@ # Distributed under the terms of the GNU General Public License v2 if [[ $# -lt 1 ]] ; then - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh + source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - helpers_die "${0##*/}: at least one argument needed" + __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --cc bin/ebuild-helpers/doins index 511eb17b9,c534f3f39..343a150b2 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@@ -33,22 -33,13 +33,22 @@@ f case "$EAPI" in 0|1|2) export ED="${D}" ;; esac if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then - vecho "-------------------------------------------------------" 1>&2 - vecho "You should not use \${D} or \${ED} with helpers." 1>&2 - vecho " --> ${INSDESTTREE}" 1>&2 - vecho "-------------------------------------------------------" 1>&2 - helpers_die "${helper} used with \${D} or \${ED}" + __vecho "-------------------------------------------------------" 1>&2 + __vecho "You should not use \${D} or \${ED} with helpers." 1>&2 + __vecho " --> ${INSDESTTREE}" 1>&2 + __vecho "-------------------------------------------------------" 1>&2 + __helpers_die "${helper} used with \${D} or \${ED}" exit 1 fi +# PREFIX LOCAL: check for usage with EPREFIX +if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then + vecho "-------------------------------------------------------" 1>&2 + vecho "You should not use \${EPREFIX} with helpers." 1>&2 + vecho " --> ${INSDESTTREE}" 1>&2 + vecho "-------------------------------------------------------" 1>&2 + exit 1 +fi +# END PREFIX LOCAL case "$EAPI" in 0|1|2|3) diff --cc bin/ebuild-helpers/doman index 96735f771,c10296b34..dd5440d7b --- a/bin/ebuild-helpers/doman +++ b/bin/ebuild-helpers/doman @@@ -2,10 -2,10 +2,10 @@@ # 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 +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/dosbin index 694953de7,edc458465..9765b7529 --- a/bin/ebuild-helpers/dosbin +++ b/bin/ebuild-helpers/dosbin @@@ -2,10 -2,10 +2,10 @@@ # 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 +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/dosym index b96f84521,34637c2f7..a98d053b0 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@@ -2,10 -2,10 +2,10 @@@ # Copyright 1999-2012 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 diff --cc bin/ebuild-helpers/ecompress index fe974ccb5,71287b4b0..6614cdc5a --- a/bin/ebuild-helpers/ecompress +++ b/bin/ebuild-helpers/ecompress @@@ -2,10 -2,10 +2,10 @@@ # 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" + __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --cc bin/ebuild-helpers/ecompressdir index bf76b1f1a,097ade2bc..464dd378c --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@@ -2,10 -2,10 +2,10 @@@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh if [[ -z $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/emake index 197e0dabb,69d836f1a..60286ec9d --- a/bin/ebuild-helpers/emake +++ b/bin/ebuild-helpers/emake @@@ -22,7 -22,7 +22,7 @@@ if [[ $PORTAGE_QUIET != 1 ]] ; the ) >&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/emerge-webrsync index cdcf716de,09b75746c..10ce71dce --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@@ -196,11 -189,9 +196,11 @@@ get_snapshot_timestamp() sync_local() { local file="$1" - vecho "Syncing local tree ..." + __vecho "Syncing local tree ..." - local ownership="portage:portage" + # PREFIX LOCAL: use PORTAGE_USER and PORTAGE_GROUP + local ownership="${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage}" + # END PREFIX LOCAL if has usersync ${FEATURES} ; then case "${USERLAND}" in BSD) diff --cc bin/misc-functions.sh index 8c6a12683,55d37f29d..b66ded412 mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -1,5 -1,5 +1,5 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # # Miscellaneous shell functions that make use of the ebuild env but don't need @@@ -155,12 -165,8 +168,10 @@@ install_qa_check() [[ " ${FEATURES} " == *" force-prefix "* ]] || \ case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac - cd "${ED}" || die "cd failed" + # PREFIX LOCAL: ED needs not to exist, whereas D does + cd "${D}" || die "cd failed" + # END PREFIX LOCAL - # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since - # QA_DT_HASH is deprecated. qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}" eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")" if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then @@@ -276,14 -259,12 +264,14 @@@ fi # Now we look for all world writable files. - local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :") + # PREFIX LOCAL: keep offset in the paths + local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${D}:- :") + # END PREFIX LOCAL if [[ -n ${unsafe_files} ]] ; then - vecho "QA Security Notice: world writable file(s):" - vecho "${unsafe_files}" - vecho "- This may or may not be a security problem, most of the time it is one." - vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly." + __vecho "QA Security Notice: world writable file(s):" + __vecho "${unsafe_files}" + __vecho "- This may or may not be a security problem, most of the time it is one." + __vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly." sleep 1 fi @@@ -621,13 -565,12 +609,12 @@@ install_qa_check_misc() # 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 "${ED}"opt/*/lib{,32,64} \ - "${ED}"lib{,32,64} \ - "${ED}"usr/lib{,32,64} \ - "${ED}"usr/X11R6/lib{,32,64} ; do + for i in "${ED}"opt/*/lib* \ + "${ED}"lib* \ + "${ED}"usr/lib* ; do [[ ! -d ${i} ]] && continue - for j in "${i}"/*.so.* "${i}"/*.so ; do + for j in "${i}"/*.so.* "${i}"/*.so "${i}"/*.dylib "${i}"/*.dll ; do [[ ! -e ${j} ]] && continue [[ -L ${j} ]] && continue [[ -x ${j} ]] && continue @@@ -681,17 -620,12 +668,17 @@@ [[ ${abort} == "yes" ]] && die "add those ldscripts" # Make sure people don't store libtool files or static libs in /lib - f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null) + # PREFIX LOCAL: on AIX, "dynamic libs" have extension .a, so don't + # get false positives + [[ ${CHOST} == *-aix* ]] \ + && f=$(ls "${ED}"lib*/*.la 2>/dev/null || true) \ + || f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null) + # END PREFIX LOCAL if [[ -n ${f} ]] ; then - vecho -ne '\n' + __vecho -ne '\n' eqawarn "QA Notice: Excessive files found in the / partition" eqawarn "${f}" - vecho -ne '\n' + __vecho -ne '\n' die "static archives (*.a) and libtool library files (*.la) do not belong in /" fi diff --cc bin/phase-functions.sh index 857dc6edf,97e762a39..a9b014ae1 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@@ -137,13 -137,13 +137,13 @@@ __filter_readonly_variables() fi fi - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" + "${PORTAGE_PYTHON:-@PREFIX_PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" } - # @FUNCTION: preprocess_ebuild_env + # @FUNCTION: __preprocess_ebuild_env # @DESCRIPTION: # Filter any readonly variables from ${T}/environment, source it, and then - # save it via save_ebuild_env(). This process should be sufficient to prevent + # save it via __save_ebuild_env(). This process should be sufficient to prevent # any stale variables or functions from an arbitrary environment from # interfering with the current environment. This is useful when an existing # environment needs to be loaded from a binary or installed package. diff --cc cnf/make.globals index 17d102536,bc69abe12..53c4bb68b --- a/cnf/make.globals +++ b/cnf/make.globals @@@ -66,13 -66,6 +66,12 @@@ FEATURES="assume-digests binpkg-log COLLISION_IGNORE="/lib/modules/* *.py[co]" UNINSTALL_IGNORE="/lib/modules/*" - # Enable preserve-libs for testing with portage versions that support it. - # This setting is commented out for portage versions that don't support it. ++# Prefix: we want preserve-libs, not sure how mainline goes about this +FEATURES="${FEATURES} preserve-libs" + +# Force EPREFIX, ED and EROOT to exist in all EAPIs, not just 3 and up +FEATURES="${FEATURES} force-prefix" + # Default chunksize for binhost comms PORTAGE_BINHOST_CHUNKSIZE="3000" diff --cc pym/_emerge/Package.py index fd8539e81,b60f74486..315811c7a --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@@ -12,8 -12,8 +12,9 @@@ from portage.dep import Atom, check_req from portage.versions import _pkg_str, _unknown_repo from portage.eapi import _get_eapi_attrs from portage.exception import InvalidDependString + from portage.localization import _ from _emerge.Task import Task +from portage.const import EPREFIX if sys.hexversion >= 0x3000000: basestring = str @@@ -36,12 -36,14 +37,14 @@@ class Package(Task) metadata_keys = [ "BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "EAPI", - "INHERITED", "IUSE", "KEYWORDS", + "HDEPEND", "INHERITED", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND", "repository", "PROPERTIES", "RESTRICT", "SLOT", "USE", - "_mtime_", "DEFINED_PHASES", "REQUIRED_USE"] + "_mtime_", "DEFINED_PHASES", "REQUIRED_USE", "EPREFIX"] - _dep_keys = ('DEPEND', 'PDEPEND', 'RDEPEND',) + _dep_keys = ('DEPEND', 'HDEPEND', 'PDEPEND', 'RDEPEND') + _buildtime_keys = ('DEPEND', 'HDEPEND') + _runtime_keys = ('PDEPEND', 'RDEPEND') _use_conditional_misc_keys = ('LICENSE', 'PROPERTIES', 'RESTRICT') UNKNOWN_REPO = _unknown_repo diff --cc pym/_emerge/actions.py index ae8df10cb,f7ec07ab4..c8d04f26d --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@@ -30,9 -30,8 +30,9 @@@ from portage import o from portage import shutil from portage import eapi_is_supported, _unicode_decode from portage.cache.cache_errors import CacheError +from portage.const import EPREFIX from portage.const import GLOBAL_CONFIG_PATH - from portage.const import _ENABLE_DYN_LINK_MAP + from portage.const import _DEPCLEAN_LIB_CHECK_DEFAULT from portage.dbapi.dep_expand import dep_expand from portage.dbapi._expand_new_virt import expand_new_virt from portage.dep import Atom diff --cc pym/portage/dbapi/bintree.py index a2c4ec475,cbcfa728f..b18229515 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@@ -73,10 -72,11 +73,12 @@@ class bindbapi(fakedbapi) self.cpdict={} # Selectively cache metadata in order to optimize dep matching. self._aux_cache_keys = set( - ["BUILD_TIME", "CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS", + ["BUILD_TIME", "CHOST", "DEPEND", "EAPI", + "HDEPEND", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", - "RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES" + "RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES", - "EPREFIX"]) ++ "EPREFIX" + ]) self._aux_cache_slot_dict = slot_dict_class(self._aux_cache_keys) self._aux_cache = {} @@@ -303,22 -303,24 +305,24 @@@ class binarytree(object) self._pkgindex_keys.update(["CPV", "MTIME", "SIZE"]) self._pkgindex_aux_keys = \ ["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI", - "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", + "HDEPEND", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES", - "BASE_URI"] + "BASE_URI", "EPREFIX"] self._pkgindex_aux_keys = list(self._pkgindex_aux_keys) self._pkgindex_use_evaluated_keys = \ - ("LICENSE", "RDEPEND", "DEPEND", + ("DEPEND", "HDEPEND", "LICENSE", "RDEPEND", "PDEPEND", "PROPERTIES", "PROVIDE") self._pkgindex_header_keys = set([ "ACCEPT_KEYWORDS", "ACCEPT_LICENSE", "ACCEPT_PROPERTIES", "CBUILD", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES", - "GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE"]) + "GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE", "EPREFIX"]) self._pkgindex_default_pkg_data = { "BUILD_TIME" : "", + "DEFINED_PHASES" : "", "DEPEND" : "", "EAPI" : "0", + "HDEPEND" : "", "IUSE" : "", "KEYWORDS": "", "LICENSE" : "", @@@ -330,9 -332,8 +334,8 @@@ "RESTRICT": "", "SLOT" : "0", "USE" : "", - "DEFINED_PHASES" : "", } - self._pkgindex_inherited_keys = ["CHOST", "repository"] + self._pkgindex_inherited_keys = ["CHOST", "repository", "EPREFIX"] # Populate the header with appropriate defaults. self._pkgindex_default_header_data = { diff --cc pym/portage/dbapi/vartree.py index 5ecdf81b3,f8980f7a0..4a01d7a11 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@@ -42,8 -39,7 +42,7 @@@ portage.proxy.lazyimport.lazyimport(glo ) from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ - PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH + PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH, EPREFIX, EPREFIX_LSTRIP, BASH_BINARY - from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_PRESERVE_LIBS from portage.dbapi import dbapi from portage.exception import CommandNotFound, \ InvalidData, InvalidLocation, InvalidPackageName, \ @@@ -176,25 -171,9 +175,20 @@@ class vardbapi(dbapi) self._counter_path = os.path.join(self._eroot, CACHE_PATH, "counter") - self._plib_registry = None - if _ENABLE_PRESERVE_LIBS: - self._plib_registry = PreservedLibsRegistry(settings["ROOT"], - os.path.join(self._eroot, PRIVATE_PATH, - "preserved_libs_registry")) - - self._linkmap = None - if _ENABLE_DYN_LINK_MAP: - chost = self.settings.get('CHOST') - if not chost: - chost = 'lunix?' # this happens when profiles are not available - if chost.find('darwin') >= 0: - self._linkmap = LinkageMapMachO(self) - elif chost.find('interix') >= 0 or chost.find('winnt') >= 0: - self._linkmap = LinkageMapPeCoff(self) - elif chost.find('aix') >= 0: - self._linkmap = LinkageMapXCoff(self) - else: - self._linkmap = LinkageMap(self) + self._plib_registry = PreservedLibsRegistry(settings["ROOT"], + os.path.join(self._eroot, PRIVATE_PATH, "preserved_libs_registry")) + self._linkmap = LinkageMap(self) ++ chost = self.settings.get('CHOST') ++ if not chost: ++ chost = 'lunix?' # this happens when profiles are not available ++ if chost.find('darwin') >= 0: ++ self._linkmap = LinkageMapMachO(self) ++ elif chost.find('interix') >= 0 or chost.find('winnt') >= 0: ++ self._linkmap = LinkageMapPeCoff(self) ++ elif chost.find('aix') >= 0: ++ self._linkmap = LinkageMapXCoff(self) ++ else: ++ self._linkmap = LinkageMap(self) self._owners = self._owners_db(self) self._cached_counter = None diff --cc pym/portage/util/env_update.py index 1486508da,4c1fbf891..6dc15a6f8 --- a/pym/portage/util/env_update.py +++ b/pym/portage/util/env_update.py @@@ -86,9 -87,10 +87,10 @@@ def _env_update(makelinks, target_root else: settings = env - eprefix = settings.get("EPREFIX", "") + eprefix = settings.get("EPREFIX", portage.const.EPREFIX) eprefix_lstrip = eprefix.lstrip(os.sep) - envd_dir = os.path.join(target_root, eprefix_lstrip, "etc", "env.d") + eroot = normalize_path(os.path.join(target_root, eprefix_lstrip)).rstrip(os.sep) + os.sep + envd_dir = os.path.join(eroot, "etc", "env.d") ensure_dirs(envd_dir, mode=0o755) fns = listdir(envd_dir, EmptyOnError=1) fns.sort() @@@ -304,12 -318,11 +318,11 @@@ penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n" penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n" cenvnotice = penvnotice[:] - penvnotice += "# GO INTO /etc/profile NOT /etc/profile.env\n\n" - cenvnotice += "# GO INTO /etc/csh.cshrc NOT /etc/csh.env\n\n" + penvnotice += "# GO INTO " + eprefix + "/etc/profile NOT /etc/profile.env\n\n" + cenvnotice += "# GO INTO " + eprefix + "/etc/csh.cshrc NOT /etc/csh.env\n\n" #create /etc/profile.env for bash support - outfile = atomic_ofstream(os.path.join( - target_root, eprefix_lstrip, "etc", "profile.env")) + outfile = atomic_ofstream(os.path.join(eroot, "etc", "profile.env")) outfile.write(penvnotice) env_keys = [ x for x in env if x != "LDPATH" ]