diff options
author | 2014-08-19 16:26:16 +0200 | |
---|---|---|
committer | 2014-08-19 16:26:16 +0200 | |
commit | e6726e6973442267ab71721cd07b72badce50672 (patch) | |
tree | aa299de63371ce773b33b37c63a6f4c22a9f82a2 | |
parent | fix find_targets (diff) | |
download | eselect-rust-e6726e6973442267ab71721cd07b72badce50672.tar.gz eselect-rust-e6726e6973442267ab71721cd07b72badce50672.tar.bz2 eselect-rust-e6726e6973442267ab71721cd07b72badce50672.zip |
update action: --if-invalid option added0.1_pre20140819
-rw-r--r-- | src/modules/rust.eselect | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/rust.eselect b/src/modules/rust.eselect index 5e11223..5f1a576 100644 --- a/src/modules/rust.eselect +++ b/src/modules/rust.eselect @@ -245,8 +245,27 @@ describe_unset() { echo "Unset active rust version" } +describe_update_options() { + echo "--if-invalid : Unset only if symlink is invalid (e.g. package was uninstalled)" +} + do_unset() { - [[ $# -gt 0 ]] && die -q "Too many parameters" + local if_invalid="0" + while [[ $# > 0 ]]; do + case "$1" in + --if-invalid) + if_invalid="1" + ;; + *) + die -q "Unrecognized argument '$1'" + ;; + esac + shift + done + + if [[ "${if_invalid}" == "1" && -e "${EROOT}"/usr/bin/rustc ]]; then + return + fi unset_version || die -q "Couldn't unset active version" } |