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 43F44138CDB for ; Wed, 10 Jun 2015 15:45:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E3D3E084C; Wed, 10 Jun 2015 15:45:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 780C0E07DF for ; Wed, 10 Jun 2015 15:45:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 2D1BE3409EC for ; Wed, 10 Jun 2015 15:45:14 +0000 (UTC) From: Mike Frysinger To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH] require PORTAGE_{BIN,PYM}_PATH not be cleared Date: Wed, 10 Jun 2015 11:45:09 -0400 Message-Id: <1433951109-18393-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1433140493-3288-1-git-send-email-vapier@gentoo.org> References: <1433140493-3288-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: b131c957-5be3-49e9-b090-6846e7a54f47 X-Archives-Hash: 04f80a81b4290b0911ef3d3cbd88209d Rather than hardcode a full path everywhere as a fallback, assume the value is always set to the right location. The current path isn't the right place anymore already. If it turns out we want to support this scenario, we can do it via a bunch of bootstrapping (and symlinked) files. --- bin/ebuild-helpers/die | 2 +- bin/ebuild-helpers/dobin | 2 +- bin/ebuild-helpers/doconfd | 2 +- bin/ebuild-helpers/dodir | 2 +- bin/ebuild-helpers/dodoc | 2 +- bin/ebuild-helpers/doenvd | 2 +- bin/ebuild-helpers/doexe | 2 +- bin/ebuild-helpers/dohard | 2 +- bin/ebuild-helpers/doheader | 2 +- bin/ebuild-helpers/dohtml | 6 ++---- bin/ebuild-helpers/doinfo | 2 +- bin/ebuild-helpers/doinitd | 2 +- bin/ebuild-helpers/doins | 2 +- bin/ebuild-helpers/dolib | 2 +- bin/ebuild-helpers/doman | 2 +- bin/ebuild-helpers/domo | 2 +- bin/ebuild-helpers/dosbin | 2 +- bin/ebuild-helpers/dosed | 2 +- bin/ebuild-helpers/dosym | 2 +- bin/ebuild-helpers/ecompress | 2 +- bin/ebuild-helpers/ecompressdir | 2 +- bin/ebuild-helpers/elog | 2 +- bin/ebuild-helpers/emake | 2 +- bin/ebuild-helpers/fowners | 2 +- bin/ebuild-helpers/fperms | 2 +- bin/ebuild-helpers/keepdir | 2 +- bin/ebuild-helpers/newins | 2 +- bin/ebuild-helpers/portageq | 4 +--- bin/ebuild-helpers/prepall | 2 +- bin/ebuild-helpers/prepalldocs | 2 +- bin/ebuild-helpers/prepallinfo | 2 +- bin/ebuild-helpers/prepallman | 2 +- bin/ebuild-helpers/prepallstrip | 2 +- bin/ebuild-helpers/prepinfo | 2 +- bin/ebuild-helpers/prepman | 2 +- bin/ebuild-helpers/prepstrip | 3 +-- bin/ebuild-helpers/unprivileged/chown | 4 ++-- bin/ebuild-helpers/xattr/install | 2 -- bin/ebuild-ipc | 4 +--- bin/ebuild.sh | 3 --- bin/helper-functions.sh | 2 +- bin/isolated-functions.sh | 2 +- bin/misc-functions.sh | 2 +- 43 files changed, 43 insertions(+), 55 deletions(-) diff --git a/bin/ebuild-helpers/die b/bin/ebuild-helpers/die index 9869141..5c6b1d2 100755 --- a/bin/ebuild-helpers/die +++ b/bin/ebuild-helpers/die @@ -2,6 +2,6 @@ # Copyright 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}"/isolated-functions.sh || exit 1 die "$@" exit 1 diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin index 0ba1eb0..9f4d73d 100755 --- a/bin/ebuild-helpers/dobin +++ b/bin/ebuild-helpers/dobin @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/doconfd b/bin/ebuild-helpers/doconfd index 1baa3ed..926c318 100755 --- a/bin/ebuild-helpers/doconfd +++ b/bin/ebuild-helpers/doconfd @@ -3,7 +3,7 @@ # 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}"/isolated-functions.sh || exit 1 __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir index e03ba9a..eed2c8b 100755 --- a/bin/ebuild-helpers/dodir +++ b/bin/ebuild-helpers/dodir @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc index 6ccf0a4..75029eb 100755 --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ___eapi_dodoc_supports_-r; then __PORTAGE_HELPER='dodoc' exec doins "$@" diff --git a/bin/ebuild-helpers/doenvd b/bin/ebuild-helpers/doenvd index 67bb934..eb31f37 100755 --- a/bin/ebuild-helpers/doenvd +++ b/bin/ebuild-helpers/doenvd @@ -3,7 +3,7 @@ # 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}"/isolated-functions.sh || exit 1 __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe index c34fcae..8c4b9e9 100755 --- a/bin/ebuild-helpers/doexe +++ b/bin/ebuild-helpers/doexe @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard index e0a44fa..8a93fad 100755 --- a/bin/ebuild-helpers/dohard +++ b/bin/ebuild-helpers/dohard @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_dohard; then die "'${0##*/}' has been banned for EAPI '$EAPI'" diff --git a/bin/ebuild-helpers/doheader b/bin/ebuild-helpers/doheader index e4cae6a..b827086 100755 --- a/bin/ebuild-helpers/doheader +++ b/bin/ebuild-helpers/doheader @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_doheader; then die "${0##*/} is not supported in EAPI ${EAPI}" diff --git a/bin/ebuild-helpers/dohtml b/bin/ebuild-helpers/dohtml index 0478e49..860d4ab 100755 --- a/bin/ebuild-helpers/dohtml +++ b/bin/ebuild-helpers/dohtml @@ -2,17 +2,15 @@ # Copyright 2009-2013 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}"/isolated-functions.sh || exit 1 if ___eapi_has_dohtml_deprecated; then eqawarn "'${0##*/}' is deprecated in EAPI '$EAPI'" fi -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} # Use safe cwd, avoiding unsafe import for bug #469338. export __PORTAGE_HELPER_CWD=${PWD} -cd "${PORTAGE_PYM_PATH}" +cd "${PORTAGE_PYM_PATH}" || die PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@" diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo index 2edbdc5..24b5ddd 100755 --- a/bin/ebuild-helpers/doinfo +++ b/bin/ebuild-helpers/doinfo @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ -z $1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/doinitd b/bin/ebuild-helpers/doinitd index aa7b66c..a216d98 100755 --- a/bin/ebuild-helpers/doinitd +++ b/bin/ebuild-helpers/doinitd @@ -3,7 +3,7 @@ # 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}"/isolated-functions.sh || exit 1 __helpers_die "${0##*/}: at least one argument needed" exit 1 fi diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins index c60e057..93052c2 100755 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 helper=${__PORTAGE_HELPER:-${0##*/}} diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib index fd92d7f..a11bad4 100755 --- a/bin/ebuild-helpers/dolib +++ b/bin/ebuild-helpers/dolib @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman index d680859..da66ac3 100755 --- a/bin/ebuild-helpers/doman +++ b/bin/ebuild-helpers/doman @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo index 9a8dda3..9742173 100755 --- a/bin/ebuild-helpers/domo +++ b/bin/ebuild-helpers/domo @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 mynum=${#} if [ ${mynum} -lt 1 ] ; then diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin index 361ca83..2fee9d4 100755 --- a/bin/ebuild-helpers/dosbin +++ b/bin/ebuild-helpers/dosbin @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed index 7db0629..1e10d12 100755 --- a/bin/ebuild-helpers/dosed +++ b/bin/ebuild-helpers/dosed @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_dosed; then die "'${0##*/}' has been banned for EAPI '$EAPI'" diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym index 649b100..0bc8cc7 100755 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ $# -ne 2 ]] ; then __helpers_die "${0##*/}: two arguments needed" diff --git a/bin/ebuild-helpers/ecompress b/bin/ebuild-helpers/ecompress index 71287b4..50ee811 100755 --- a/bin/ebuild-helpers/ecompress +++ b/bin/ebuild-helpers/ecompress @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if [[ -z $1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir index eca5888..4f57262 100755 --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@ -2,7 +2,7 @@ # Copyright 1999-2013 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}"/helper-functions.sh || exit 1 if [[ -z $1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --git a/bin/ebuild-helpers/elog b/bin/ebuild-helpers/elog index a2303af..911f8d5 100755 --- a/bin/ebuild-helpers/elog +++ b/bin/ebuild-helpers/elog @@ -2,6 +2,6 @@ # Copyright 1999-2009 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}"/isolated-functions.sh || exit 1 ${0##*/} "$@" diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake index 2a3c2f0..60718a2 100755 --- a/bin/ebuild-helpers/emake +++ b/bin/ebuild-helpers/emake @@ -9,7 +9,7 @@ # # With newer EAPIs, we also automatically fail the build if make itself fails. -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 cmd=( ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE} diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners index cee4108..85f7fd6 100755 --- a/bin/ebuild-helpers/fowners +++ b/bin/ebuild-helpers/fowners @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then EPREFIX= ED=${D} diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms index d854ebb..297679c 100755 --- a/bin/ebuild-helpers/fperms +++ b/bin/ebuild-helpers/fperms @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir index bec2feb..e0c852d 100755 --- a/bin/ebuild-helpers/keepdir +++ b/bin/ebuild-helpers/keepdir @@ -2,7 +2,7 @@ # Copyright 1999-2013 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/newins b/bin/ebuild-helpers/newins index 0335985..8032a8f 100755 --- a/bin/ebuild-helpers/newins +++ b/bin/ebuild-helpers/newins @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 helper=${0##*/} diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq index ba889eb..b314bce 100755 --- a/bin/ebuild-helpers/portageq +++ b/bin/ebuild-helpers/portageq @@ -5,10 +5,8 @@ scriptpath=${BASH_SOURCE[0]} scriptname=${scriptpath##*/} -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} # Use safe cwd, avoiding unsafe import for bug #469338. -cd "${PORTAGE_PYM_PATH}" +cd "${PORTAGE_PYM_PATH}" || exit 1 IFS=':' set -f # in case ${PATH} contains any shell glob characters diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall index fb5c2db..44643bb 100755 --- a/bin/ebuild-helpers/prepall +++ b/bin/ebuild-helpers/prepall @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs index 3094661..cf63c64 100755 --- a/bin/ebuild-helpers/prepalldocs +++ b/bin/ebuild-helpers/prepalldocs @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ___eapi_has_docompress; then die "'${0##*/}' has been banned for EAPI '$EAPI'" diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo index 1a20275..cdf149e 100755 --- a/bin/ebuild-helpers/prepallinfo +++ b/bin/ebuild-helpers/prepallinfo @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman index 5331eaf..03b10a8 100755 --- a/bin/ebuild-helpers/prepallman +++ b/bin/ebuild-helpers/prepallman @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 # replaced by controllable compression in EAPI 4 ___eapi_has_docompress && exit 0 diff --git a/bin/ebuild-helpers/prepallstrip b/bin/ebuild-helpers/prepallstrip index 1aa6686..59fa7cc 100755 --- a/bin/ebuild-helpers/prepallstrip +++ b/bin/ebuild-helpers/prepallstrip @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo index 5afc18a..a64d144 100755 --- a/bin/ebuild-helpers/prepinfo +++ b/bin/ebuild-helpers/prepinfo @@ -2,7 +2,7 @@ # 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}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman index fb5dcb4..e64acc0 100755 --- a/bin/ebuild-helpers/prepman +++ b/bin/ebuild-helpers/prepman @@ -5,7 +5,7 @@ # Do not compress man pages which are smaller than this (in bytes). #169260 SIZE_LIMIT='128' -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 if ! ___eapi_has_prefix_variables; then ED=${D} diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip index 2ef8a1a..43caa29 100755 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@ -2,8 +2,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh +source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1 # avoid multiple calls to `has`. this creates things like: # FEATURES_foo=false diff --git a/bin/ebuild-helpers/unprivileged/chown b/bin/ebuild-helpers/unprivileged/chown index 2f1f161..b57dc8a 100755 --- a/bin/ebuild-helpers/unprivileged/chown +++ b/bin/ebuild-helpers/unprivileged/chown @@ -2,6 +2,8 @@ # Copyright 2012-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 + scriptpath=${BASH_SOURCE[0]} scriptname=${scriptpath##*/} @@ -23,8 +25,6 @@ for path in ${PATH}; do output="${output}\n ... (further messages truncated)" fi - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh - if ! ___eapi_has_prefix_variables; then EPREFIX= fi diff --git a/bin/ebuild-helpers/xattr/install b/bin/ebuild-helpers/xattr/install index 2d2a693..4d596e1 100755 --- a/bin/ebuild-helpers/xattr/install +++ b/bin/ebuild-helpers/xattr/install @@ -2,8 +2,6 @@ # Copyright 2013-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} INSTALL_XATTR=${EPREFIX}/usr/bin/install-xattr # Use safe cwd, avoiding unsafe import for bug #469338. export __PORTAGE_HELPER_CWD=${PWD} diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc index 820005f..e77b94b 100755 --- a/bin/ebuild-ipc +++ b/bin/ebuild-ipc @@ -2,9 +2,7 @@ # Copyright 2010-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} # Use safe cwd, avoiding unsafe import for bug #469338. -cd "${PORTAGE_PYM_PATH}" +cd "${PORTAGE_PYM_PATH}" || exit 1 PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@" diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 4e26f87..75a9d24 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -2,9 +2,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}" -PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}" - # Prevent aliases from causing portage to act inappropriately. # Make sure it's before everything so we don't mess aliases that follow. unalias -a diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh index b9bc74a..c096aed 100644 --- a/bin/helper-functions.sh +++ b/bin/helper-functions.sh @@ -5,7 +5,7 @@ # For routines we want to use in ebuild-helpers/ but don't want to # expose to the general ebuild environment. -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 # # API functions for doing parallel processing diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 8e789ec..003c01d 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -2,7 +2,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/eapi.sh" +source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1 # We need this next line for "die" and "assert". It expands # It _must_ preceed all the calls to die and assert. diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 24941af..9b79351 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -14,7 +14,7 @@ MISC_FUNCTIONS_ARGS="$@" shift $# -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh" +source "${PORTAGE_BIN_PATH}/ebuild.sh" || exit 1 install_symlink_html_docs() { if ! ___eapi_has_prefix_variables; then -- 2.4.1