From 2d8eaedb61bdbe4a47d6b27c8a3e67754078773d Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Sat, 14 Aug 2010 03:11:41 +0200 Subject: [PATCH] Use /usr/bin/python when PORTAGE_PYTHON variable is empty. It avoids some errors during upgrade from older Portage versions. --- bin/ebuild-helpers/dohtml | 2 +- bin/ebuild-helpers/portageq | 2 +- bin/ebuild-ipc | 2 +- bin/ebuild.sh | 8 ++++---- bin/misc-functions.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/ebuild-helpers/dohtml b/bin/ebuild-helpers/dohtml index 6de730c6d..cb29dc3f3 100755 --- a/bin/ebuild-helpers/dohtml +++ b/bin/ebuild-helpers/dohtml @@ -7,7 +7,7 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \ - "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/dohtml.py" "$@" + "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@" ret=$? [[ $ret -ne 0 ]] && helpers_die "$0 failed" diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq index 8dee54c32..ec30b66cb 100755 --- a/bin/ebuild-helpers/portageq +++ b/bin/ebuild-helpers/portageq @@ -5,4 +5,4 @@ PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \ - exec "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/portageq" "$@" + exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/portageq" "$@" diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc index 45d0f15b8..43e4a02ae 100755 --- a/bin/ebuild-ipc +++ b/bin/ebuild-ipc @@ -5,4 +5,4 @@ PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \ - exec "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@" + exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@" diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 6a2eeb1e6..e9f4b96cb 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -165,7 +165,7 @@ has_version() { fi PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" local retval=$? case "${retval}" in 0) @@ -186,7 +186,7 @@ portageq() { fi PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" "$@" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@" } @@ -208,7 +208,7 @@ best_version() { fi PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1" local retval=$? case "${retval}" in 0) @@ -1728,7 +1728,7 @@ filter_readonly_variables() { " fi - "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed" } # @FUNCTION: preprocess_ebuild_env diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 8207006ed..0108b001f 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -489,7 +489,7 @@ install_qa_check() { done [[ $reset_debug = 1 ]] && set -x f=$(cat "${PORTAGE_LOG_FILE}" | \ - "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed") + "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed") if [[ -n ${f} ]] ; then # In the future this will be a forced "die". In preparation, @@ -779,7 +779,7 @@ dyn_package() { bzip2 -cf > "$PORTAGE_BINPKG_TMPFILE" assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'" PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \ + "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \ "$PORTAGE_BINPKG_TMPFILE" "$PORTAGE_BUILDDIR/build-info" if [ $? -ne 0 ]; then rm -f "${PORTAGE_BINPKG_TMPFILE}" -- 2.26.2