Permalink
Browse files

improved naming rubies when both path and name specified, fix #2663

  • Loading branch information...
mpapis committed Mar 9, 2014
1 parent 36cfd98 commit 59f3972344168a0cbb188cf5f547380d3abfa891
Showing with 15 additions and 2 deletions.
  1. +15 −2 scripts/external
View
@@ -328,7 +328,7 @@ external_propose_name()
external_import_configure()
{
- typeset platform architecture libc
+ typeset platform architecture libc __tmp
if (( ${rvm_install_flag:-0} > 0 ))
then err_command=rvm_warn
@@ -358,6 +358,17 @@ external_import_configure()
rvm_ruby_string="${rvm_ruby_string##*/}"
rvm_ruby_string="${rvm_ruby_string/bin-/}"
rvm_ruby_string="${rvm_ruby_string%.t*}"
+ if
+ [[ -n "${rvm_ruby_name}" ]]
+ then
+ __tmp="$rvm_ruby_string"
+ rvm_ruby_string="${rvm_ruby_name}"
+ if
+ [[ "${rvm_ruby_name}" == "${__tmp}"* ]]
+ then
+ detected_rvm_ruby_name="${rvm_ruby_name#${__tmp}-}"
+ fi
+ fi
__rvm_ruby_package_file "${rvm_ruby_string}"
if
[[ "${rvm_ruby_package_file}" == *bin-* ]]
@@ -419,7 +430,9 @@ external_import_validate_archive()
elif
[[ "${short_ruby_string/-bin-/-}" == "${downloaded_names[*]}" ]]
then
- rvm_ruby_string="${short_ruby_string/-bin-/-}"
+ if [[ -z "${rvm_ruby_string}" ]]
+ then rvm_ruby_string="${short_ruby_string/-bin-/-}"
+ fi
__path_to_extract="${short_ruby_string}"
elif
[[ "${short_ruby_string/rbx-/rubinius-}" == "${downloaded_names[*]}" ]]

0 comments on commit 59f3972

Please sign in to comment.