diff options
author | 2008-05-21 12:28:45 +0000 | |
---|---|---|
committer | 2008-05-21 12:28:45 +0000 | |
commit | 38433ef66ea4a93fc3546c1e462bc7b9b4725a34 (patch) | |
tree | 7162ec3f53e645f94c79a9afe032562bf87a5f34 | |
parent | Tag version 20080124 (diff) | |
download | eselect-python-38433ef66ea4a93fc3546c1e462bc7b9b4725a34.tar.gz eselect-python-38433ef66ea4a93fc3546c1e462bc7b9b4725a34.tar.bz2 eselect-python-38433ef66ea4a93fc3546c1e462bc7b9b4725a34.zip |
Implement update --if-unset. Borrowed from vi.eselect
-rw-r--r-- | python.eselect | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python.eselect b/python.eselect index 645bdec..cb973a6 100644 --- a/python.eselect +++ b/python.eselect @@ -138,7 +138,18 @@ describe_update() { echo "Switch to the most recent CPython." } +describe_update_options() { + echo "--if-unset : Do not override existing implementation" +} + do_update() { + [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \ + die -q "Usage error" + + if [[ -L "${ROOT}/usr/bin/python" ]]; then + [[ ${1} == "--if-unset" ]] && return + fi + local targets=( $(cd "${INTERPRETER_PATH}"; ls python?.?|sort -r) ) target target=${targets[0]} echo "Switching to ${target}" |