summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'python.eselect')
-rw-r--r--python.eselect17
1 files changed, 15 insertions, 2 deletions
diff --git a/python.eselect b/python.eselect
index eb5bcad..d48e771 100644
--- a/python.eselect
+++ b/python.eselect
@@ -30,12 +30,25 @@ set_python_script() {
#!/bin/sh
# Gentoo Python wrapper script
-[[ "\${EPYTHON}" == "${script##*/}" ]] && EPYTHON="${target}"
+[[ "\${EPYTHON}" =~ (/|^python\$) ]] && EPYTHON="${target}"
"\${0%/*}/\${EPYTHON:-${target}}" "\$@"
EOF
chmod +x "${script}"
}
+set_python_config_script() {
+ local script="${INTERPRETER_PATH}${1}" target="${2}"
+ cat << EOF > "${script}"
+#!/bin/sh
+# Gentoo python-config wrapper script
+
+[[ "\${EPYTHON}" =~ (/|^python\$) ]] && EPYTHON="${target/-config-/}"
+python_config="\${EPYTHON/python/python-config-}"
+"\${0%/*}/\${python_config:-${target}}" "\$@"
+EOF
+ chmod +x "${script}"
+}
+
# Try to remove python and python.1 symlinks
remove_symlinks() {
local symlink symlink_target symlink_target_found
@@ -91,7 +104,7 @@ set_scripts_and_symlinks() {
pushd "${INTERPRETER_PATH}" 1>/dev/null
set_python_script "python" "${target}"
ln -nfs "${target}" "${target%.*}"
- ln -nfs "${target/python/python-config-}" python-config
+ set_python_config_script "python-config" "${target/python/python-config-}"
ln -nfs "${target/python/pydoc}" pydoc
ln -nfs "${target/python/idle}" idle
# 2to3 for >=2.6