diff options
author | Jauhien Piatlicki <jauhien@gentoo.org> | 2014-08-19 12:04:04 +0200 |
---|---|---|
committer | Jauhien Piatlicki <jauhien@gentoo.org> | 2014-08-19 12:04:04 +0200 |
commit | ccb7dbe9e5c259a9094f51145d3bc0362676c5e8 (patch) | |
tree | 6a5c8f5c91a37a5a784e38152917954e85b571c5 | |
parent | first working version (diff) | |
download | eselect-rust-ccb7dbe9e5c259a9094f51145d3bc0362676c5e8.tar.gz eselect-rust-ccb7dbe9e5c259a9094f51145d3bc0362676c5e8.tar.bz2 eselect-rust-ccb7dbe9e5c259a9094f51145d3bc0362676c5e8.zip |
add update action
-rw-r--r-- | src/modules/rust.eselect | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/modules/rust.eselect b/src/modules/rust.eselect index 2aa63a7..e334e9b 100644 --- a/src/modules/rust.eselect +++ b/src/modules/rust.eselect @@ -200,3 +200,35 @@ do_set() { set_version "$1" || die -q "Couldn't set new active version" } + +### update action ### + +describe_update() { + echo "Switch to the most recent rust compiler" +} + +describe_update_options() { + echo "--if-unset : Do not override existing implementation" +} + +do_update() { + local if_unset="0" + while [[ $# > 0 ]]; do + case "$1" in + --if-unset) + if_unset="1" + ;; + *) + die -q "Unrecognized argument '$1'" + ;; + esac + shift + done + + if [[ "${if_unset}" == "1" && -f "${EROOT}"/usr/bin/rustc ]]; then + return + fi + + local targets=( $(find_targets) ) + do_set ${#targets[@]} +} |