From: Fabian Groffen Date: Thu, 6 Sep 2012 17:59:38 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0dfc79ae85eeb0ac4101d80eaf659aeca1fcf8cd;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/archive-conf bin/banned-helper bin/binhost-snapshot bin/clean_locks bin/dispatch-conf bin/ebuild bin/ebuild-helpers/bsd/sed bin/ebuild-helpers/dodoc bin/ebuild-helpers/dohard bin/ebuild-helpers/dosed bin/ebuild-helpers/prepalldocs bin/emaint bin/emerge bin/env-update bin/fixpackages bin/glsa-check bin/phase-functions.sh bin/phase-helpers.sh bin/quickpkg bin/regenworld bin/repoman bin/save-ebuild-env.sh --- 0dfc79ae85eeb0ac4101d80eaf659aeca1fcf8cd diff --cc bin/archive-conf index 149fdc51d,af34db628..a48fc1917 --- a/bin/archive-conf +++ b/bin/archive-conf @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 1999-2006 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # diff --cc bin/binhost-snapshot index 54d210218,fe2cf6b53..f5b99798e --- a/bin/binhost-snapshot +++ b/bin/binhost-snapshot @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 2010-2011 Gentoo Foundation + # Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import io diff --cc bin/clean_locks index c97794fac,09ee3e516..29c22ff00 --- a/bin/clean_locks +++ b/bin/clean_locks @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python -O +#!@PREFIX_PORTAGE_PYTHON@ -O - # Copyright 1999-2006 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/ebuild-helpers/bsd/sed index 8c979e92f,01b88471d..89f9ec6a3 --- a/bin/ebuild-helpers/bsd/sed +++ b/bin/ebuild-helpers/bsd/sed @@@ -1,16 -1,11 +1,18 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 2007 Gentoo Foundation + # Copyright 2007-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 scriptpath=${BASH_SOURCE[0]} scriptname=${scriptpath##*/} ++# PREFIX LOCAL: warn about screwups early +if [[ -n ${EPREFIX} ]] ; then + echo "When using Prefix, this BSD sed wrapper should not exist (in ${scriptpath})! This is a bug!" > /dev/stderr + exit 1 +fi ++# END PREFIX LOCAL + - if [[ sed == ${scriptname} ]] && [[ -n ${ESED} ]]; then + if [[ sed == ${scriptname} && -n ${ESED} ]]; then exec ${ESED} "$@" elif type -P g${scriptname} > /dev/null ; then exec g${scriptname} "$@" diff --cc bin/ebuild-helpers/dodoc index 0ba67512d,d6ce67933..4b9c8b95f --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@@ -1,8 -1,19 +1,19 @@@ -#!/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 + case "${EAPI}" in + 0|1|2|3) + ;; + *) + exec \ + env \ + __PORTAGE_HELPER="dodoc" \ + doins "$@" + ;; + 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" diff --cc bin/ebuild-helpers/dohard index 2fb0ede2a,6ae93d240..bd83b5d1e --- a/bin/ebuild-helpers/dohard +++ b/bin/ebuild-helpers/dohard @@@ -1,7 -1,16 +1,16 @@@ -#!/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 + case "${EAPI}" in + 0|1|2|3) + ;; + *) + die "'${0##*/}' has been banned for EAPI '$EAPI'" + exit 1 + ;; + esac + if [[ $# -ne 2 ]] ; then echo "$0: two arguments needed" 1>&2 exit 1 diff --cc bin/ebuild-helpers/doins index ca6b0bae4,26b11a869..511eb17b9 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@@ -2,9 -2,11 +2,11 @@@ # 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 [[ ${0##*/} == dodoc ]] ; then + helper=${__PORTAGE_HELPER:-${0##*/}} + + if [[ ${helper} == dodoc ]] ; then if [ $# -eq 0 ] ; then # default_src_install may call dodoc with no arguments # when DOC is defined but empty, so simply return @@@ -35,18 -37,9 +37,18 @@@ if [[ ${INSDESTTREE#${ED}} != "${INSDES 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} or \${ED}" + 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/dosed index 0f2f6370b,24ec20587..3e903fcb3 --- a/bin/ebuild-helpers/dosed +++ b/bin/ebuild-helpers/dosed @@@ -1,7 -1,16 +1,16 @@@ -#!/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 + case "${EAPI}" in + 0|1|2|3) + ;; + *) + die "'${0##*/}' has been banned for EAPI '$EAPI'" + exit 1 + ;; + esac + if [[ $# -lt 1 ]] ; then echo "!!! ${0##*/}: at least one argument needed" >&2 exit 1 diff --cc bin/ebuild-helpers/prepalldocs index 648efbaf9,c9226d603..a890801af --- a/bin/ebuild-helpers/prepalldocs +++ b/bin/ebuild-helpers/prepalldocs @@@ -1,9 -1,18 +1,18 @@@ -#!/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 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh + case "${EAPI}" in + 0|1|2|3) + ;; + *) + die "'${0##*/}' has been banned for EAPI '$EAPI'" + exit 1 + ;; + esac + if [[ -n $1 ]] ; then vecho "${0##*/}: invalid usage; takes no arguments" 1>&2 fi diff --cc bin/env-update index 32c251e02,cee3fd683..ef3433f5a --- a/bin/env-update +++ b/bin/env-update @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python -O +#!@PREFIX_PORTAGE_PYTHON@ -O - # Copyright 1999-2006 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/fixpackages index 57b6db3b2,da08520e5..3f37e3f37 --- a/bin/fixpackages +++ b/bin/fixpackages @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/glsa-check index f513b583c,eddc9050e..7b8e98ab7 --- a/bin/glsa-check +++ b/bin/glsa-check @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 2008-2011 Gentoo Foundation + # Copyright 2008-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/phase-functions.sh index fdf17d879,68a33a871..37ee7f218 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@@ -29,7 -29,7 +29,7 @@@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_ PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \ PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \ PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \ - __PORTAGE_TEST_HARDLINK_LOCKS ED EROOT" - __PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS" ++ __PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS ED EROOT" PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR" diff --cc bin/phase-helpers.sh index 10a7b3e58,0587991f9..df51a5bba --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@@ -611,10 -688,10 +688,10 @@@ has_version() ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then - "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1" + "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "${atom}" else PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1" - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "${atom}" ++ "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "${atom}" fi local retval=$? case "${retval}" in @@@ -646,10 -745,10 +745,10 @@@ best_version() ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then - "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1" + "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "${atom}" else PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1" - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "${atom}" ++ "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "${atom}" fi local retval=$? case "${retval}" in diff --cc bin/regenworld index 44e821b5e,a2833445a..0b7da44c8 --- a/bin/regenworld +++ b/bin/regenworld @@@ -1,19 -1,17 +1,15 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import sys - # 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 + pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") + sys.path.insert(0, pym_path) + import portage from portage import os -from portage._sets.files import StaticFileSet, WorldSelectedSet - import re import tempfile import textwrap diff --cc bin/save-ebuild-env.sh index 1169c0900,6d6ed41b6..74193e79e --- a/bin/save-ebuild-env.sh +++ b/bin/save-ebuild-env.sh @@@ -1,5 -1,5 +1,5 @@@ -#!/bin/bash +#!@PORTAGE_PREFIX_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @FUNCTION: save_ebuild_env diff --cc pym/_emerge/EbuildBuildDir.py index 5e2c03455,5d6a26232..7cabee0da --- a/pym/_emerge/EbuildBuildDir.py +++ b/pym/_emerge/EbuildBuildDir.py @@@ -5,10 -5,8 +5,9 @@@ from _emerge.AsynchronousLock import As import portage from portage import os +import sys from portage.exception import PortageException from portage.util.SlotObject import SlotObject - import errno class EbuildBuildDir(SlotObject): diff --cc pym/portage/package/ebuild/doebuild.py index ff8ad1252,471a5daeb..1c5ac389f --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@@ -131,13 -147,16 +149,13 @@@ def _doebuild_path(settings, eapi=None) eprefix = settings["EPREFIX"] prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x] rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x] - - prefixes = [] - if eprefix: - prefixes.append(eprefix) - prefixes.append("/") - + # PREFIX LOCAL: use DEFAULT_PATH and EXTRA_PATH from make.globals + defaultpath = [x for x in settings.get("DEFAULT_PATH", "").split(":") if x] + extrapath = [x for x in settings.get("EXTRA_PATH", "").split(":") if x] path = [] - if eapi not in (None, "0", "1", "2", "3"): - path.append(os.path.join(portage_bin_path, "ebuild-helpers", "4")) + if settings.get("USERLAND", "GNU") != "GNU": + path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd")) path.append(os.path.join(portage_bin_path, "ebuild-helpers")) path.extend(prerootpath)