Permalink
Browse files

Don't mangle the supplied path in __rvm_ruby_string_paths_under

  • Loading branch information...
1 parent 65fbe9b commit 54f52533b063c62a459227aa7e36dd9554d35943 @Sutto Sutto committed Jul 1, 2010
Showing with 14 additions and 13 deletions.
  1. +1 −1 scripts/gemsets
  2. +9 −9 scripts/manage
  3. +4 −3 scripts/utility
View
@@ -394,7 +394,7 @@ gemset_initial() {
$rvm_scripts_path/log "info" "Importing initial gemsets for $(__rvm_environment_identifier)."
mkdir -p "$rvm_gemsets_path/$(echo "$rvm_ruby_string" | tr '-' '/')" 2>/dev/null
for gemsets_path in $(__rvm_ruby_string_paths_under "$rvm_gemsets_path") ; do
- if [[ ! -z "$rvm_gemset_name" ]] ; then
+ if [[ -n "$rvm_gemset_name" ]] ; then
if [[ -s "${gemsets_path}/${rvm_gemset_name}.gems" ]] ; then
(source "$rvm_scripts_path/rvm"; rvm gemset import "${gemsets_path}/${rvm_gemset_name}.gems") > /dev/null
fi
View
@@ -325,10 +325,10 @@ RubyWrapper
__rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags"
- export ruby="$rvm_bin_path/$(__rvm_18_compat_ruby)"
+ export ruby="$(__rvm_18_compat_ruby)"
rvm_ruby_configure_flags="${rvm_ruby_configure_flags:-"--skip-system"}"
- rvm_ruby_configure="$ruby configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags" ; message="Configuring rbx"
+ rvm_ruby_configure="$rvm_bin_path/$ruby configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags" ; message="Configuring rbx"
if [[ "$rvm_llvm_flag" = "0" ]] ; then
rvm_ruby_configure="$rvm_ruby_configure --disable-llvm"
else
@@ -342,9 +342,9 @@ RubyWrapper
fi
if [[ "$rvm_trace_flag" -eq 1 ]] ; then
- rvm_ruby_make="$ruby -S rake install --trace" ; message="Compiling rbx (with --trace)"
+ rvm_ruby_make="$rvm_wrappers_path/$ruby/rake install --trace" ; message="Compiling rbx (with --trace)"
else
- rvm_ruby_make="$ruby -S rake install" ; message="Compiling rbx"
+ rvm_ruby_make="$rvm_wrappers_path/$ruby/rake install" ; message="Compiling rbx"
fi
__rvm_run "rake" "$rvm_ruby_make" "$message"
result=$? ; if [[ "$result" -gt 0 ]] ; then
@@ -509,14 +509,14 @@ RubyWrapper
if [[ ! -e ${rvm_ruby_home}/etc/conf.d/maglev.conf ]] ; then
$rvm_scripts_path/log "info" "Creating default 'maglev' repository."
- $rvm_bin_path/rvm "$(compatible_ruby)" rake "stone:create[maglev]" >/dev/null 2>&1
+ $rvm_wrappers_path/$compatible_ruby/rake "stone:create[maglev]" >/dev/null 2>&1
fi
$rvm_scripts_path/log "info" "Generating maglev HTML documentation"
- $rvm_bin_path/rvm "$(compatible_ruby)" rake rdoc >/dev/null 2>&1
+ $rvm_wrappers_path/$compatible_ruby/rake rdoc >/dev/null 2>&1
$rvm_scripts_path/log "info" "Generating smalltalk FFI."
- $rvm_bin_path/rvm "$(compatible_ruby)" rake stwrappers >/dev/null 2>&1
+ $rvm_wrappers_path/$compatible_ruby/rake stwrappers >/dev/null 2>&1
unset compatible_ruby
@@ -555,10 +555,10 @@ RubyWrapper
compatible_ruby="$(__rvm_18_compat_ruby)"
- $rvm_bin_path/rvm "$(compatible_ruby)" -S gem install pathname2 --no-rdoc --no-ri
+ $rvm_wrappers_path/$compatible_ruby/gem install pathname2 --no-rdoc --no-ri
# MONO_LIB=/Library/Frameworks/Mono.framework/Versions/current/lib/
- rvm_ruby_make="$rvm_bin_path/rvm $(compatible_ruby) -S rake MERLIN_ROOT=\"$rvm_ruby_src_path/Merlin/Main\" compile mono=1 configuration=release --trace"
+ rvm_ruby_make="$rvm_wrappers_path/$compatible_ruby/rake MERLIN_ROOT=\"$rvm_ruby_src_path/Merlin/Main\" compile mono=1 configuration=release --trace"
__rvm_run "rake" "$rvm_ruby_make" "Building IronRuby..."
unset compatible_ruby
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
View
@@ -30,9 +30,10 @@ __rvm_teardown() {
# Return a list of directories under a given base path.
# Derived from rvm_ruby_string.
__rvm_ruby_string_paths_under() {
- local patch_parts="$(echo "$1 $rvm_ruby_string" | __rvm_strip | tr '-' ' ')"
- while [[ -n "$patch_parts" ]]; do
- echo "$patch_parts" | tr ' ' '/'
+ local patch_parts="$(echo "$rvm_ruby_string" | tr '-' ' ' | __rvm_strip)"
+ while true; do
+ echo "$1/$patch_parts" | tr ' ' '/' | sed 's#\/$##'
+ [[ -z "$patch_parts" ]] && break
patch_parts="$(echo "$patch_parts" | awk '{$NF=""; print}' | __rvm_strip)"
done
}

0 comments on commit 54f5253

Please sign in to comment.