--- python.eselect.orig +++ python.eselect @@ -26,14 +26,10 @@ find_targets() { set_python_script() { local script="${INTERPRETER_PATH}${1}" target="${2}" - cat << EOF > "${script}" -#!/bin/sh -# Gentoo Python wrapper script - -[[ "\${EPYTHON}" =~ (/|^python\$) ]] && EPYTHON="${target}" -"\${0%/*}/\${EPYTHON:-${target}}" "\$@" -EOF - chmod +x "${script}" + if [[ ! -L ${script} ]]; then + ln -s ${EPREFIX}/usr/libexec/python-wrapper ${script} + fi + echo "${target} > "${ENV_D_PATH}/python/config" } set_python_config_script() { @@ -138,8 +134,9 @@ describe_show() { } do_show() { - active=$(canonicalise "${INTERPRETER_PATH}python") - echo ${active#${INTERPRETER_PATH}} + if [[ -f "${ENV_D_PATH}/python/config" ]]; then + cat "${ENV_D_PATH}/python/config" + fi } ### list action ### @@ -215,7 +212,7 @@ do_update() { shift done - if [[ -L "${ROOT%/}/usr/bin/python" ]]; then + if [[ -f "${ENV_D_PATH}/python/config" ]]; then ${if_unset} && return fi