diff options
author | alex <alex@localhost.(none)> | 2009-07-31 21:59:09 +0200 |
---|---|---|
committer | alex <alex@localhost.(none)> | 2009-07-31 21:59:09 +0200 |
commit | d26a652cfeeca55db74221f10d1b89a97c8cf333 (patch) | |
tree | 4d10c3d9a28525a0f81b57d684b72191759b5efa /eselect-ruby | |
parent | Add patches for thread lock problems. (diff) | |
download | ruby-scripts-d26a652cfeeca55db74221f10d1b89a97c8cf333.tar.gz ruby-scripts-d26a652cfeeca55db74221f10d1b89a97c8cf333.tar.bz2 ruby-scripts-d26a652cfeeca55db74221f10d1b89a97c8cf333.zip |
Remove symlinks or link to latest still available ruby on emerge -C ruby, bug 277858.
Diffstat (limited to 'eselect-ruby')
-rw-r--r-- | eselect-ruby/ruby.eselect | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/eselect-ruby/ruby.eselect b/eselect-ruby/ruby.eselect index e15b88a..85cb5eb 100644 --- a/eselect-ruby/ruby.eselect +++ b/eselect-ruby/ruby.eselect @@ -177,3 +177,24 @@ do_set() { create_symlinks ${target} } + +### cleanup action ### +describe_cleanup() { + echo "Called on removal of ruby. Activates the latest available version, or just removes the symlinks." +} + +do_cleanup() { + [[ -z ${@} ]] || die -q "This function does not expect any arguments" + + local targets=( $(find_targets) ) + + remove_symlinks || \ + die -q "Could not remove symlinks" + + if [[ ${#targets[@]} -ne 0 ]] ; then + echo "Marking the latest still installed version as default..." + create_symlinks ${targets[@]: -1} + else + echo "No ruby profiles left on the system. Stale symlinks removed." + fi +} |