Use /usr/bin/python when PORTAGE_PYTHON variable is empty.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sat, 14 Aug 2010 01:11:41 +0000 (03:11 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sat, 14 Aug 2010 01:11:41 +0000 (03:11 +0200)
It avoids some errors during upgrade from older Portage versions.

bin/ebuild-helpers/dohtml
bin/ebuild-helpers/portageq
bin/ebuild-ipc
bin/ebuild.sh
bin/misc-functions.sh

index 6de730c6d3bca93433623c62e7bc7815de46e098..cb29dc3f3e13de2a1835198cdef0e6402f617706 100755 (executable)
@@ -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"
index 8dee54c32616c6161ca6e3a1d30c4d478cdb1426..ec30b66cbef86e1a6aff501870bdc9b2668b2301 100755 (executable)
@@ -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" "$@"
index 45d0f15b8240dd8008ff48ceaee43dc2b4d41ae6..43e4a02aef415648136ae391212c77a3ab67be00 100755 (executable)
@@ -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" "$@"
index 6a2eeb1e62c81afb15c8d4d8a1c25077bc09185b..e9f4b96cb897abb1e77ba46eb71329e3fe4af4b8 100755 (executable)
@@ -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
index 8207006ed0245a04bde1b36397581549a5a30030..0108b001f8e953d9b4a4ebc6c66105ff2e30527f 100755 (executable)
@@ -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}"