Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…inary archive, fix #2662
  • Loading branch information...
commit 36cfd98560703fa13ce21fe2649d4f91610d9888 1 parent b9e0484
@mpapis mpapis authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 scripts/external
View
18 scripts/external
@@ -398,6 +398,7 @@ 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$"
@@ -405,27 +406,28 @@ external_import_validate_archive()
__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
Please sign in to comment.
Something went wrong with that request. Please try again.