aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJauhien Piatlicki <jauhien@gentoo.org>2014-08-19 16:26:16 +0200
committerJauhien Piatlicki <jauhien@gentoo.org>2014-08-19 16:26:16 +0200
commite6726e6973442267ab71721cd07b72badce50672 (patch)
treeaa299de63371ce773b33b37c63a6f4c22a9f82a2
parentfix find_targets (diff)
downloadeselect-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.eselect21
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"
}