Permalink
Browse files

remove name from ruby string before checking for path in downloaded b…

…inary archive, fix #2662
  • Loading branch information...
1 parent b9e0484 commit 36cfd98560703fa13ce21fe2649d4f91610d9888 @mpapis mpapis committed Mar 9, 2014
Showing with 10 additions and 8 deletions.
  1. +10 −8 scripts/external
View
@@ -398,34 +398,36 @@ external_import_download()
external_import_validate_archive()
{
typeset -a downloaded_names path_to_bin_ruby
+ typeset short_ruby_string
__rvm_read_lines path_to_bin_ruby <(
__rvm_package_list "$rvm_archives_path/${rvm_ruby_package_file}" | __rvm_grep "bin/ruby$"
)
__rvm_read_lines downloaded_names <(
__rvm_package_list "$rvm_archives_path/${rvm_ruby_package_file}" | __rvm_awk -F/ '{print $1}' | sort -u
)
+ short_ruby_string="${rvm_ruby_string%-${detected_rvm_ruby_name:-}}"
if
[[ "${#path_to_bin_ruby[*]}" -eq 1 ]]
then
__path_to_extract="${path_to_bin_ruby[*]}"
__path_to_extract="${__path_to_extract%bin/ruby}"
elif
- [[ "${rvm_ruby_string}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string}" == "${downloaded_names[*]}" ]]
then
- __path_to_extract="${rvm_ruby_string}"
+ __path_to_extract="${short_ruby_string}"
elif
- [[ "${rvm_ruby_string/-bin-/-}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string/-bin-/-}" == "${downloaded_names[*]}" ]]
then
- rvm_ruby_string="${rvm_ruby_string/-bin-/-}"
- __path_to_extract="${rvm_ruby_string}"
+ rvm_ruby_string="${short_ruby_string/-bin-/-}"
+ __path_to_extract="${short_ruby_string}"
elif
- [[ "${rvm_ruby_string/rbx-/rubinius-}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string/rbx-/rubinius-}" == "${downloaded_names[*]}" ]]
then
- __path_to_extract="${rvm_ruby_string/rbx-/rubinius-}"
+ __path_to_extract="${short_ruby_string/rbx-/rubinius-}"
else
$err_command "The downloaded package for ${rvm_ruby_url},
-Does not contains single 'bin/ruby' or '${rvm_ruby_string}',
+Does not contains single 'bin/ruby' or '${short_ruby_string}',
Only '${downloaded_names[*]}' were found instead."
return 4
fi

0 comments on commit 36cfd98

Please sign in to comment.