From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 53642138010 for ; Thu, 6 Sep 2012 18:14:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8BA4321C032; Thu, 6 Sep 2012 18:14:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4CBE021C032 for ; Thu, 6 Sep 2012 18:14:05 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8F7A633D74A for ; Thu, 6 Sep 2012 18:14:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4B40BE543D for ; Thu, 6 Sep 2012 18:14:03 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1346954378.0dfc79ae85eeb0ac4101d80eaf659aeca1fcf8cd.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: / X-VCS-Repository: proj/portage X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 0dfc79ae85eeb0ac4101d80eaf659aeca1fcf8cd X-VCS-Branch: prefix Date: Thu, 6 Sep 2012 18:14:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c783c155-a0bf-4da9-b52b-23611d342e5a X-Archives-Hash: 341b1534b8b770c49ef352a242be43c8 commit: 0dfc79ae85eeb0ac4101d80eaf659aeca1fcf8cd Author: Fabian Groffen gentoo org> AuthorDate: Thu Sep 6 17:59:38 2012 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Sep 6 17:59:38 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0dfc79ae 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 NEWS | 4 +- bin/archive-conf | 7 +- bin/banned-helper | 6 - bin/binhost-snapshot | 13 +- bin/clean_locks | 11 +- bin/dispatch-conf | 14 +- bin/ebuild | 9 +- bin/ebuild-helpers/4/dodoc | 1 - bin/ebuild-helpers/4/dohard | 1 - bin/ebuild-helpers/4/dosed | 1 - bin/ebuild-helpers/4/prepalldocs | 1 - bin/ebuild-helpers/{ => bsd}/sed | 16 +- bin/ebuild-helpers/dodoc | 13 +- bin/ebuild-helpers/dohard | 11 +- bin/ebuild-helpers/doheader | 21 ++ bin/ebuild-helpers/doins | 16 +- bin/ebuild-helpers/dosed | 11 +- bin/ebuild-helpers/{newbin => newheader} | 0 bin/ebuild-helpers/newins | 2 +- bin/ebuild-helpers/prepalldocs | 11 +- bin/ebuild.sh | 2 +- bin/egencache | 11 +- bin/emaint | 11 +- bin/emerge | 8 +- bin/env-update | 12 +- bin/etc-update | 15 +- bin/fixpackages | 13 +- bin/glsa-check | 13 +- bin/phase-functions.sh | 34 ++- bin/phase-helpers.sh | 141 +++++++++-- bin/portageq | 58 +++-- bin/quickpkg | 8 +- bin/regenworld | 12 +- bin/repoman | 12 +- bin/save-ebuild-env.sh | 11 +- cnf/make.globals | 2 +- doc/package/ebuild.docbook | 1 + doc/package/ebuild/eapi/4-slot-abi.docbook | 12 +- doc/package/ebuild/eapi/5.docbook | 260 ++++++++++++++++++++ doc/portage.docbook | 1 + man/ebuild.5 | 7 +- man/emerge.1 | 16 +- man/make.conf.5 | 5 - pym/_emerge/EbuildBuildDir.py | 7 +- pym/_emerge/EbuildMetadataPhase.py | 6 +- pym/_emerge/FakeVartree.py | 20 +- pym/_emerge/Package.py | 21 +- pym/_emerge/Scheduler.py | 19 +- pym/_emerge/create_depgraph_params.py | 20 +- pym/_emerge/depgraph.py | 131 ++++++----- pym/_emerge/main.py | 22 +- pym/_emerge/resolver/backtracking.py | 16 +- pym/_emerge/resolver/circular_dependency.py | 9 +- pym/_emerge/resolver/slot_collision.py | 4 +- pym/portage/__init__.py | 2 +- pym/portage/_sets/__init__.py | 17 ++ pym/portage/_sets/dbapi.py | 86 +++++++- pym/portage/const.py | 5 +- pym/portage/dbapi/__init__.py | 15 +- pym/portage/dbapi/_expand_new_virt.py | 10 +- pym/portage/dep/__init__.py | 141 ++++++----- .../dep/{_slot_abi.py => _slot_operator.py} | 24 +- pym/portage/eapi.py | 23 ++- pym/portage/emaint/modules/config/config.py | 66 ++---- pym/portage/glsa.py | 3 +- .../package/ebuild/_config/special_env_vars.py | 8 +- pym/portage/package/ebuild/_eapi_invalid.py | 13 - pym/portage/package/ebuild/config.py | 104 ++++++++- pym/portage/package/ebuild/doebuild.py | 49 +++-- pym/portage/tests/dep/testAtom.py | 16 +- pym/portage/tests/dep/testCheckRequiredUse.py | 16 ++- .../tests/dep/test_get_required_use_flags.py | 4 +- pym/portage/tests/dep/test_match_from_list.py | 6 +- pym/portage/tests/emerge/test_simple.py | 2 +- pym/portage/tests/resolver/test_complete_graph.py | 4 +- pym/portage/tests/resolver/test_slot_abi.py | 26 +- .../tests/resolver/test_slot_abi_downgrade.py | 8 +- pym/portage/util/_desktop_entry.py | 23 ++- pym/portage/versions.py | 10 +- 79 files changed, 1223 insertions(+), 567 deletions(-) diff --cc bin/archive-conf index 149fdc5,af34db6..a48fc19 --- 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 54d2102,fe2cf6b..f5b9979 --- 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 c97794f,09ee3e5..29c22ff --- 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 8c979e9,01b8847..89f9ec6 --- 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 0ba6751,d6ce679..4b9c8b9 --- 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 2fb0ede,6ae93d2..bd83b5d --- 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 ca6b0ba,26b11a8..511eb17 --- 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 0f2f637,24ec205..3e903fc --- 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 648efba,c9226d6..a890801 --- 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 32c251e,cee3fd6..ef3433f --- 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 57b6db3,da08520..3f37e3f --- 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 f513b58,eddc905..7b8e98a --- 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 fdf17d8,68a33a8..37ee7f2 --- 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 10a7b3e,0587991..df51a5b --- 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 44e821b,a283344..0b7da44 --- 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 1169c09,6d6ed41..74193e7 --- 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 5e2c034,5d6a262..7cabee0 --- 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 ff8ad12,471a5da..1c5ac38 --- 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)