#!/bin/bash
-# Copyright 2009 Gentoo Foundation
+# Copyright 2009-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
PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
-# Set EPYTHON variable as empty so that dohtml.py doesn't try
-# to use potentially unsupported version of Python.
-EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- "$PORTAGE_BIN_PATH/dohtml.py" "$@"
+PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+ "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
#!/bin/bash
-# Copyright 2009 Gentoo Foundation
+# Copyright 2009-2010 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}
-# Set EPYTHON variable as empty so that portageq doesn't try
-# to use potentially unsupported version of Python.
-EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "$PORTAGE_BIN_PATH/portageq" "$@"
+PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+ exec "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/portageq" "$@"
PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
-# Set EPYTHON variable as empty so that ebuild-ipc.py doesn't try
-# to use potentially unsupported version of Python.
-EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"
+PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+ exec "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"
#!/bin/bash
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
return $?
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1"
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+ "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
local retval=$?
case "${retval}" in
0)
die "portageq calls are not allowed in the global scope"
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}/portageq" "$@"
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+ "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" "$@"
}
return $?
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+ "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
local retval=$?
case "${retval}" in
0)
"
fi
- EPYTHON= "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
+ "$PORTAGE_PYTHON" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
}
# @FUNCTION: preprocess_ebuild_env
#!/bin/bash
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Miscellaneous shell functions that make use of the ebuild env but don't need
done
[[ $reset_debug = 1 ]] && set -x
f=$(cat "${PORTAGE_LOG_FILE}" | \
- EPYTHON= "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
+ "$PORTAGE_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,
tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
bzip2 -cf > "$PORTAGE_BINPKG_TMPFILE"
assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'"
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
+ "$PORTAGE_PYTHON" "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \
"$PORTAGE_BINPKG_TMPFILE" "$PORTAGE_BUILDDIR/build-info"
if [ $? -ne 0 ]; then
rm -f "${PORTAGE_BINPKG_TMPFILE}"
# END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END
# ===========================================================================
+os.environ['PORTAGE_PYTHON'] = sys.executable
+
def _ensure_default_encoding():
default_encoding = sys.getdefaultencoding().lower().replace('-', '_')
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import os
import shutil
import tempfile
from portage import os
tmpdir = tempfile.mkdtemp()
try:
env = {}
+ env['PORTAGE_PYTHON'] = os.environ['PORTAGE_PYTHON']
env['PORTAGE_BIN_PATH'] = PORTAGE_BIN_PATH
env['PORTAGE_PYM_PATH'] = PORTAGE_PYM_PATH
env['PORTAGE_BUILDDIR'] = tmpdir