diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-08-01 01:04:39 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-08-01 01:04:39 +0000 |
commit | d5cdf810b663fcd2371f016d630532d976c3b9b9 (patch) | |
tree | 6b5522b27ec56832f0106dd07e9003e123ea9ae9 | |
parent | Support .xz extension (bug #276106). (diff) | |
download | eselect-python-d5cdf810b663fcd2371f016d630532d976c3b9b9.tar.gz eselect-python-d5cdf810b663fcd2371f016d630532d976c3b9b9.tar.bz2 eselect-python-d5cdf810b663fcd2371f016d630532d976c3b9b9.zip |
Make python-config a script.
-rw-r--r-- | python.eselect | 17 |
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 |