From d2fd51aa75cd0e1a11034bcf5cdc1cd29b81c937 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 10 Dec 2009 19:14:07 +0000 Subject: [PATCH] forward port r15024 svn path=/main/branches/prefix/; revision=15027 --- bin/ebuild.sh | 7 +++---- man/ebuild.5 | 25 +++++++++++++++---------- pym/portage/__init__.py | 11 ++++++----- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 59def7e78..7b33dda8a 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1606,11 +1606,10 @@ READONLY_EBUILD_METADATA="DEFINED_PHASES DEPEND DESCRIPTION PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI" READONLY_PORTAGE_VARS="D EBUILD EBUILD_PHASE \ - EBUILD_SH_ARGS EMERGE_FROM FILESDIR PORTAGE_BINPKG_FILE \ - PORTAGE_BIN_PATH PORTAGE_IUSE \ + EBUILD_SH_ARGS ED EMERGE_FROM EROOT FILESDIR \ + PORTAGE_BINPKG_FILE PORTAGE_BIN_PATH PORTAGE_IUSE \ PORTAGE_PYM_PATH PORTAGE_MUTABLE_FILTERED_VARS \ - PORTAGE_SAVED_READONLY_VARS PORTAGE_TMPDIR T WORKDIR \ - ED EROOT" + PORTAGE_SAVED_READONLY_VARS PORTAGE_TMPDIR T WORKDIR" PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR" diff --git a/man/ebuild.5 b/man/ebuild.5 index d69a18d3b..a229bf90a 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -15,7 +15,7 @@ Here's a simple example ebuild: .DS .nf -# Copyright 1999\-2007 Gentoo Foundation +# Copyright 1999\-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ @@ -105,8 +105,9 @@ location in the portage tree. Do not modify this variable. .B EPREFIX Contains the offset that this Portage was configured for during installation. The offset is sometimes necessary in an ebuild or eclass, -and is available in such cases as ${EPREFIX}. Do not modify this -variable. +and is available in such cases as ${EPREFIX}. EPREFIX does not contain +a trailing slash, therefore an absent offset is represented by the empty +string. Do not modify this variable. .TP \fBS\fR = \fI"${WORKDIR}/${P}"\fR Contains the path to the temporary \fIbuild directory\fR. This variable @@ -118,13 +119,15 @@ be modified to match the extraction directory of a tarball for the package. Contains the path to a \fItemporary directory\fR. You may use this for whatever you like. .TP -\fBD\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image"\fR +\fBD\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/"\fR Contains the path to the temporary \fIinstall directory\fR. Every write operation that does not involve the helper tools and functions (found below) -should be prefixed with ${D}. Do not modify this variable. +should be prefixed with ${D}. Often the offset prefix needs to be taken +into account here, for which the variable ${ED} is provided (see below). +Do not modify this variable. .TP -\fBED\fT = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/${EPREFIX}"\fR -Contains the path "${D}${EPREFIX}" for convenience purposes. Do not +\fBED\fT = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/${EPREFIX}/"\fR +Contains the path "${D%/}${EPREFIX}/" for convenience purposes. Do not modify this variable. .TP .B PORTAGE_LOG_FILE @@ -134,10 +137,12 @@ Contains the path of the build log. If \fBPORT_LOGDIR\fR variable is unset then \fBROOT\fR = \fI"/"\fR Contains the path that portage should use as the root of the live filesystem. When packages wish to make changes to the live filesystem, they should do so in -the tree prefixed by ${ROOT}. Do not modify this variable. +the tree prefixed by ${ROOT}. Often the offset prefix needs to be taken +into account here, for which the variable ${EROOT} is provided (see +below). Do not modify this variable. .TP -\fBEROOT\fR = \fI"${ROOT}${EPREFIX%/}"\fR -Contains "${ROOT}${EPREFIX%/}" for convenience purposes. Do not modify +\fBEROOT\fR = \fI"${ROOT%/}${EPREFIX}/"\fR +Contains "${ROOT%/}${EPREFIX}/" for convenience purposes. Do not modify this variable. .TP \fBDESCRIPTION\fR = \fI"A happy little package"\fR diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 79b4b6386..9eccf5c33 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1386,12 +1386,13 @@ class config(object): _env_blacklist = [ "A", "AA", "CATEGORY", "DEPEND", "DESCRIPTION", "EAPI", - "EBUILD_PHASE", "EMERGE_FROM", "HOMEPAGE", "INHERITED", "IUSE", + "EBUILD_PHASE", "EMERGE_FROM", "EPREFIX", "EROOT", + "HOMEPAGE", "INHERITED", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PF", "PKGUSE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE", "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME", "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT", - "ROOT", "SLOT", "SRC_URI", "EPREFIX", "EROOT" + "ROOT", "SLOT", "SRC_URI" ] _environ_whitelist = [] @@ -1408,7 +1409,8 @@ class config(object): "ACCEPT_LICENSE", "BASH_ENV", "BUILD_PREFIX", "D", "DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD", "EBUILD_EXIT_STATUS_FILE", "EBUILD_FORCE_TEST", - "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM", + "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "ED", + "EMERGE_FROM", "EPREFIX", "EROOT", "FEATURES", "FILESDIR", "HOME", "NOCOLOR", "PATH", "PKGDIR", "PKGUSE", "PKG_LOGDIR", "PKG_TMPDIR", @@ -1430,8 +1432,7 @@ class config(object): "ROOT", "ROOTPATH", "STARTDIR", "T", "TMP", "TMPDIR", "USE_EXPAND", "USE_ORDER", "WORKDIR", "XARGS", - "BPREFIX", "DEFAULT_PATH", "ED", "EPREFIX", "EROOT", - "PORTAGE_GROUP", "PORTAGE_USER", + "BPREFIX", "DEFAULT_PATH", "PORTAGE_GROUP", "PORTAGE_USER" ] # user config variables -- 2.26.2