rvm 0.1.45 → 0.1.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ expand_ruby_name() {
29
29
  migrate_rubies() {
30
30
  expanded_source="$(expand_ruby_name "$source_ruby")"
31
31
  expanded_destination="$(expand_ruby_name "$destination_ruby")"
32
-
32
+
33
33
  if [[ -z "$expanded_source" ]]; then
34
34
  die_with_error "Could not expand source ruby '$source_ruby'"
35
35
  elif [[ -z "$expanded_destination" ]]; then
@@ -41,12 +41,12 @@ migrate_rubies() {
41
41
  elif [[ ! -d "$rvm_rubies_path/$expanded_destination" ]]; then
42
42
  die_with_error "Ruby '$expanded_destination' is not installed - please install it first."
43
43
  fi
44
-
44
+
45
45
  echo "Are you sure you wish to MOVE gems from $expanded_source to $expanded_destination?"
46
46
  confirm "This will overwrite existing gems in $expanded_destination and remove them from $expanded_source" || return 1
47
-
47
+
48
48
  echo "Moving gemsets..."
49
-
49
+
50
50
  while read -r origin_gemset; do
51
51
  [[ "$origin_gemset" = "$expanded_source" || "$origin_gemset" = "$expanded_source$rvm_gemset_separator"* ]] || continue
52
52
  gemset_name="$(echo "$origin_gemset" | awk -F"$rvm_gemset_separator" '{print $2}')"
@@ -55,21 +55,21 @@ migrate_rubies() {
55
55
  destination_gemset="$destination_gemset$rvm_gemset_separator$gemset_name"
56
56
  fi
57
57
  echo "Moving $origin_gemset to $destination_gemset"
58
-
59
- rm -rf "$rvm_gems_path/$destination_gemset"
58
+
59
+ \rm -rf "$rvm_gems_path/$destination_gemset"
60
60
  result="$?"
61
61
  [[ "$result" -gt "0" ]] && die_with_error "Unable to remove gem directory '$rvm_gems_path/$destination_gemset'" "$result"
62
-
62
+
63
63
  mv "$rvm_gems_path/$origin_gemset" "$rvm_gems_path/$destination_gemset"
64
64
  result="$?"
65
65
  [[ "$result" -gt "0" ]] && die_with_error "Unable to move '$rvm_gems_path/$origin_gemset' to '$rvm_gems_path/$destination_gemset'" "$result"
66
-
67
-
66
+
67
+
68
68
  echo "Making gemset $destination_gemset pristine."
69
69
  __rvm_run_with_env "gemset.pristine" "$destination_gemset" "rvm gemset pristine"
70
70
  done < <($rvm_scripts_path/list gemsets strings | grep "^$expanded_source")
71
71
  unset origin_gemset destination_gemset gemset_name
72
-
72
+
73
73
  if confirm 'Do you wish to move over aliases?' ; then
74
74
  while read -r alias_pair; do
75
75
  migrate_ruby_name="$(echo "$alias_pair" | awk -F= '{print $2}')"
@@ -83,7 +83,7 @@ migrate_rubies() {
83
83
  done < "$rvm_config_path/alias"
84
84
  unset migrate_ruby_name migrate_alias_name migrate_new_alias_name
85
85
  fi
86
-
86
+
87
87
  if confirm "Do you wish to move over wrappers?" ; then
88
88
  origin_wrappers_path="$rvm_wrappers_path/$expanded_source"
89
89
  for binary_name in $(\ls $rvm_bin_path) ; do
@@ -98,13 +98,13 @@ migrate_rubies() {
98
98
  done
99
99
  unset origin_wrappers_path full_bin_path expanded_symlink linked_binary_name new_wrapper_destination
100
100
  fi
101
-
101
+
102
102
  if confirm "Do you also wish to completely remove $expanded_source (inc. archive)?" ; then
103
103
  __rvm_run_with_env "rvm.remove" "$expanded_source" "rvm remove $expanded_source --archive --gems"
104
104
  fi
105
-
105
+
106
106
  echo "Successfully migrated $expanded_source to $expanded_destination"
107
-
107
+
108
108
  }
109
109
 
110
110
  if [[ -z "$1" || "$#" != 2 ]]; then
@@ -114,4 +114,4 @@ fi
114
114
  source_ruby="$1"; shift
115
115
  destination_ruby="$1"; shift
116
116
 
117
- migrate_rubies
117
+ migrate_rubies
@@ -27,7 +27,7 @@ push_if_timestamp_changed() {
27
27
 
28
28
  update_timestamp() {
29
29
  if [[ -d "${1}/" ]] ; then
30
- touch "$rvm_path/${$}_${1}_timestamp"
30
+ \touch "$rvm_path/${$}_${1}_timestamp"
31
31
  eval "${1}_timestamp=\$(timestamp \"$rvm_path/${$}_${1}_timestamp\")"
32
32
  fi
33
33
  }
@@ -44,7 +44,7 @@ install_package() {
44
44
  __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_usr_path"
45
45
  fi
46
46
 
47
- touch "$rvm_config_path/packages"
47
+ \touch "$rvm_config_path/packages"
48
48
  $rvm_scripts_path/db "$rvm_config_path/packages" "${package}" "${version}"
49
49
 
50
50
  __rvm_pushpop
@@ -167,7 +167,7 @@ llvm() {
167
167
  __rvm_pushpop $rvm_src_path
168
168
  if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
169
169
  __rvm_db "${package}_url" "package_url"
170
- rm -rf "$rvm_src_path/llvm"
170
+ \rm -rf "$rvm_src_path/llvm"
171
171
  svn co -r "$version" "$package_url" llvm
172
172
  builtin cd "$rvm_src_path/llvm"
173
173
  ./configure --enable-bindings=none
@@ -15,7 +15,7 @@ repair_symlinks() {
15
15
  [[ -e "$executable_name" || "$(readlink "$executable_name")" != "$rvm_wrappers_path/"* ]] && continue
16
16
  if [[ -f "$executable_name" ]] ; then
17
17
  $rvm_scripts_path/log "info" "Removing stale symlink from $(basename "$executable_name")"
18
- rm -f "$executable_name"
18
+ \rm -f "$executable_name"
19
19
  fi
20
20
  done; unset executable_name
21
21
  __rvm_pushpop
@@ -26,7 +26,7 @@ repair_environments() {
26
26
  for environment_name in $(\ls "$rvm_environments_path"); do
27
27
  [[ -L "$rvm_environments_path/$environment_name" ]] && continue
28
28
  $rvm_scripts_path/log "info" "Regenerating environment file for '$environment_name'"
29
- [[ -f "$rvm_environments_path/$environment_name" ]] && rm -f "$rvm_environments_path/$environment_name"
29
+ [[ -f "$rvm_environments_path/$environment_name" ]] && \rm -f "$rvm_environments_path/$environment_name"
30
30
  (source "$rvm_scripts_path/base"; __rvm_become "$environment_name"; __rvm_ensure_has_environment_files)
31
31
  done; unset environment_name
32
32
  }
@@ -38,7 +38,7 @@ repair_archives() {
38
38
  local stored_md5sum="$($rvm_scripts_path/db "$rvm_config_path/md5" "$archive_file" | head -n1)"
39
39
  if [[ -n "$stored_md5sum" ]] && ! $rvm_scripts_path/md5 "$rvm_archives_path/$archive_file" "$stored_md5sum" ; then
40
40
  $rvm_scripts_path/log "info" "Removing archive for '$archive_file' - Incorrect md5 checksum."
41
- rm -rf "$rvm_archives_path/$archive_file"
41
+ \rm -rf "$rvm_archives_path/$archive_file"
42
42
  fi
43
43
  done; unset archive_file
44
44
  }
@@ -27,7 +27,7 @@ rubygems_setup() {
27
27
  rubygems_dir="$(ruby -rrbconfig -e "puts Config::CONFIG.values_at('sitelibdir','vendorlibdir').detect {|path| File.directory?(File.join(path, 'rubygems')) }.to_s")"
28
28
  if [[ -n "$rubygems_dir" && -d "$rubygems_dir" ]]; then
29
29
  # Remove common files installed by ruby gems.
30
- rm -rf "${rubygems_dir}/ubygems.rb" "${rubygems_dir}/rubygems.rb" "${rubygems_dir}/rubygems" "${rubygems_dir}/gauntlet_rubygems.rb"
30
+ \rm -rf "${rubygems_dir}/ubygems.rb" "${rubygems_dir}/rubygems.rb" "${rubygems_dir}/rubygems" "${rubygems_dir}/gauntlet_rubygems.rb"
31
31
  fi
32
32
 
33
33
  $rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_string..."
@@ -39,7 +39,7 @@ rubygems_setup() {
39
39
  # Sanity check... If setup.rb is missing from the rubygems source path,
40
40
  # something went wrong. Cleanup, aisle 3!
41
41
  if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
42
- rm -rf "$rvm_src_path/$rvm_gem_package_name"
42
+ \rm -rf "$rvm_src_path/$rvm_gem_package_name"
43
43
  fi
44
44
 
45
45
  if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
@@ -48,7 +48,7 @@ rubygems_setup() {
48
48
  result=$? ; if [[ "$result" -gt 0 ]] ; then
49
49
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
50
50
  fi
51
- mkdir -p "$rvm_src_path/$rvm_gem_package_name"
51
+ \mkdir -p "$rvm_src_path/$rvm_gem_package_name"
52
52
  __rvm_run "rubygems.extract" "cat $rvm_archives_path/$rvm_gem_package_name.tgz | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_gem_package_name ..."
53
53
  fi
54
54
 
@@ -70,9 +70,9 @@ rubygems_setup() {
70
70
  fi
71
71
 
72
72
  # Add ruby's gem path to ruby's lib direcotry.
73
- mkdir -p "$(dirname $ruby_lib_gem_path)"
73
+ \mkdir -p "$(dirname $ruby_lib_gem_path)"
74
74
 
75
- if [[ -d "$ruby_lib_gem_path" ]] ; then rm -rf "$ruby_lib_gem_path" ; fi
75
+ if [[ -d "$ruby_lib_gem_path" ]] ; then \rm -rf "$ruby_lib_gem_path" ; fi
76
76
 
77
77
  ln -nfs "$rvm_ruby_gem_home" "$ruby_lib_gem_path"
78
78
 
@@ -89,7 +89,7 @@ fi
89
89
  #
90
90
  if [[ $# -gt 0 ]] ; then
91
91
  version="$1" ; shift
92
- args="$(echo "$@" | __rvm_strip)"
92
+ args="$(echo "$@" | __rvm_strip)"
93
93
  else
94
94
  $rvm_scripts_path/log "error" "A version must be specified, for example 'rvm rubygems 1.3.7'"
95
95
  exit 1
@@ -2,7 +2,7 @@
2
2
 
3
3
  # rvm : Ruby enVironment Manager
4
4
  # http://rvm.beginrescueend.com
5
- # http://gitub.com/wayneeseguin/rvm
5
+ # http://github.com/wayneeseguin/rvm
6
6
 
7
7
  rvm_reload_flag="${rvm_reload_flag:-0}"
8
8
  rvm_loaded_flag="${rvm_loaded_flag:-0}"
@@ -96,8 +96,8 @@ rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
96
96
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
97
97
 
98
98
  if [[ "$rvm_selfcontained" = "0" ]] ; then
99
- rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
100
- rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
99
+ rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
100
+ rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}"
101
101
  rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
102
102
  else
103
103
  rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
@@ -126,11 +126,11 @@ fi
126
126
 
127
127
  spinner
128
128
 
129
- mkdir -p "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path"
129
+ \mkdir -p "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path"
130
130
 
131
131
  for file in README LICENCE ; do
132
132
  spinner
133
- cp -f "$source_path/$file" "$rvm_path/"
133
+ \cp -f "$source_path/$file" "$rvm_path/"
134
134
  done
135
135
 
136
136
  #
@@ -138,22 +138,22 @@ done
138
138
  #
139
139
  for dir_name in config scripts examples lib hooks help patches; do
140
140
  spinner
141
- mkdir -p "$rvm_path/$dir_name"
141
+ \mkdir -p "$rvm_path/$dir_name"
142
142
  if [[ -d "$source_path/$dir_name" ]] ; then
143
- cp -Rf "$source_path/$dir_name" "$rvm_path"
143
+ \cp -Rf "$source_path/$dir_name" "$rvm_path"
144
144
  fi
145
145
  done ; unset dir_name
146
146
 
147
147
  spinner
148
148
  if [[ ! -s "$rvm_config_path/user" ]] ; then
149
- mkdir -p "$rvm_config_path/"
149
+ \mkdir -p "$rvm_config_path/"
150
150
  echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
151
151
  fi
152
152
 
153
153
  scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
154
154
  for script_name in "${scripts[@]}" ; do
155
155
  spinner
156
- chmod +x $rvm_scripts_path/$script_name
156
+ chmod +x "$rvm_scripts_path/$script_name" 2>/dev/null # Hide errors.
157
157
  done
158
158
 
159
159
  #
@@ -162,8 +162,8 @@ done
162
162
  # Cleanse and purge...
163
163
  for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
164
164
  spinner && perl -e 'sleep 0.2'
165
- rm -f "$rvm_bin_path/$file"
166
- cp -f "$source_path/binscripts/$file" $rvm_bin_path/
165
+ \rm -f "$rvm_bin_path/$file"
166
+ \cp -f "$source_path/binscripts/$file" $rvm_bin_path/
167
167
  done
168
168
  spinner
169
169
  chmod +x $rvm_bin_path/*
@@ -176,7 +176,7 @@ if [[ -n "$rvm_auto_flag" ]] ; then
176
176
  printf "Checking rc files... ($rvm_rc_files)"
177
177
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
178
178
  for rcfile in $(echo $rvm_rc_files) ; do
179
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
179
+ if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
180
180
  if [[ -s "$HOME/.profile" ]] ; then
181
181
  if ! grep -q '.profile' "$rcfile" ; then
182
182
  echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
@@ -196,26 +196,26 @@ fi
196
196
  #
197
197
  spinner
198
198
  if [[ -d gemsets/ ]] ; then
199
- mkdir -p "$rvm_gemsets_path"
199
+ \mkdir -p "$rvm_gemsets_path"
200
200
  for gemset_file in $(cd gemsets ; find . -iname '*.gems' | sed 's/^\.\///') ; do
201
201
  destination="$rvm_gemsets_path/$gemset_file"
202
202
  destination_path="$(dirname "$destination")"
203
203
  if [[ ! -s "$destination" ]] ; then
204
- mkdir -p "$destination_path"
205
- cp "gemsets/$gemset_file" "$destination"
204
+ \mkdir -p "$destination_path"
205
+ \cp "gemsets/$gemset_file" "$destination"
206
206
  fi
207
207
  done ; unset destination destination_path gemset_file
208
208
  fi
209
209
 
210
210
  spinner
211
211
  if [[ -d patchsets/ ]] ; then
212
- mkdir -p "$rvm_patchsets_path"
212
+ \mkdir -p "$rvm_patchsets_path"
213
213
  for patchset_file in $(cd patchsets ; find . -iname '*' | sed 's/^\.\///') ; do
214
214
  destination="$rvm_patchsets_path/$patchset_file"
215
215
  destination_path="$(dirname "$destination")"
216
216
  if [[ ! -s "$destination" ]] ; then
217
- mkdir -p "$destination_path"
218
- cp "patchsets/$patchset_file" "$destination"
217
+ \mkdir -p "$destination_path"
218
+ \cp "patchsets/$patchset_file" "$destination"
219
219
  fi
220
220
  done ; unset destination destination_path patchset_file
221
221
  fi
@@ -224,7 +224,7 @@ fi
224
224
  # Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
225
225
  #
226
226
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
227
- mkdir -p "$rvm_rubies_path/"
227
+ \mkdir -p "$rvm_rubies_path/"
228
228
  spinner
229
229
  for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
230
230
  if [[ -d "$ruby" ]] ; then
@@ -280,7 +280,7 @@ if [[ -s "$rvm_config_path/default" ]]; then
280
280
  $rvm_scripts_path/alias create default "$original_version" &> /dev/null
281
281
  fi
282
282
  unset original_version
283
- rm -rf "$rvm_config_path/default"
283
+ \rm -rf "$rvm_config_path/default"
284
284
  fi
285
285
 
286
286
  #
@@ -288,14 +288,14 @@ fi
288
288
  #
289
289
 
290
290
  printf "\n Correct permissions for base binaries in $rvm_bin_path..."
291
- mkdir -p $rvm_bin_path
291
+ \mkdir -p $rvm_bin_path
292
292
  for file in rvm rvmsudo rvm-shell rvm-auto-ruby; do
293
293
  [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
294
294
  done; unset file
295
295
  printf "\n Copying manpages into place."
296
296
  for man_file in $(\ls "$install_source_path/man"); do
297
- rm -rf "$rvm_man_path/$man_file"
298
- cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
297
+ \rm -rf "$rvm_man_path/$man_file"
298
+ \cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
299
299
  done
300
300
 
301
301
  [[ "$upgrade_flag" = 0 ]] && ./scripts/notes
@@ -319,7 +319,7 @@ if [[ "$upgrade_flag" -eq 1 ]] ; then
319
319
  check_rubyopt_conditions
320
320
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
321
321
  else
322
- if [[ -z "$rvm_prefix" ]] && [[ "root" != "$(whoami)" ]] ; then
322
+ if [[ "$rvm_selfcontained" = "1" ]] ; then
323
323
  printf "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
324
324
  printf "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
325
325
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
@@ -210,7 +210,7 @@ __rvm_select() {
210
210
 
211
211
  rvm_ruby_selected_flag=1
212
212
 
213
- mkdir -p "$rvm_ruby_log_path"
213
+ \mkdir -p "$rvm_ruby_log_path"
214
214
 
215
215
  export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_release_version rvm_major_version rvm_minor_version rvm_gemset_name rvm_gems_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
216
216
  else
@@ -219,7 +219,7 @@ __rvm_select() {
219
219
  }
220
220
 
221
221
  __rvm_use() {
222
-
222
+
223
223
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select "$@" ; fi
224
224
  if [[ -z "$rvm_ruby_interpreter" ]] ; then rvm_ruby_interpreter="system" ; fi
225
225
 
@@ -231,7 +231,7 @@ __rvm_use() {
231
231
  if [[ -s $rvm_config_path/system ]] ; then
232
232
  grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_config_path/system" > /dev/null
233
233
  if [[ $? -eq 0 ]] ; then
234
- [[ -f "$rvm_config_path/system" ]] && rm -f $rvm_config_path/system # 'system' should *not* point to an rvm ruby.
234
+ [[ -f "$rvm_config_path/system" ]] && \rm -f $rvm_config_path/system # 'system' should *not* point to an rvm ruby.
235
235
  else
236
236
  source "$rvm_config_path/system"
237
237
  fi
@@ -241,7 +241,7 @@ __rvm_use() {
241
241
  if [[ "$rvm_selfcontained" = "0" ]] ; then
242
242
  for binary in ruby gem irb ri rdoc rake erb testrb ; do
243
243
  full_binary_path="$rvm_bin_path/$binary"
244
- [[ -L "$full_binary_path" ]] && rm -f "$full_binary_path"
244
+ [[ -L "$full_binary_path" ]] && \rm -f "$full_binary_path"
245
245
  done; unset binary full_binary_path
246
246
  fi
247
247
 
@@ -299,10 +299,10 @@ __rvm_use() {
299
299
  fi
300
300
  if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
301
301
  $rvm_scripts_path/alias delete default &> /dev/null
302
- rm -f $rvm_bin_path/default*
303
- [[ -f $rvm_config_path/default ]] && rm -f $rvm_config_path/default
304
- [[ -f $rvm_environments_path/default ]] && rm -f $rvm_environments_path/default
305
- [[ -f $rvm_wrappers_path/default ]] && rm -f $rvm_wrappers_path/default
302
+ \rm -f $rvm_bin_path/default*
303
+ [[ -f $rvm_config_path/default ]] && \rm -f $rvm_config_path/default
304
+ [[ -f $rvm_environments_path/default ]] && \rm -f $rvm_environments_path/default
305
+ [[ -f $rvm_wrappers_path/default ]] && \rm -f $rvm_wrappers_path/default
306
306
  else
307
307
  RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
308
308
  export GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION
@@ -556,11 +556,11 @@ __rvm_gemset_select() {
556
556
  rvm_ruby_gem_path="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
557
557
 
558
558
  # Ensure that the ruby gem home exists.
559
- mkdir -p "$rvm_ruby_gem_home"
559
+ \mkdir -p "$rvm_ruby_gem_home"
560
560
  if [[ -n "$rvm_ruby_gem_home" ]] && echo "$rvm_ruby_gem_home" | grep -q 'rvm'; then
561
561
  if __rvm_using_gemset_globalcache && [[ ! -L "$rvm_ruby_gem_home/cache" ]]; then
562
562
  mv "$rvm_ruby_gem_home/cache/"*.gem "$rvm_gems_cache_path/" 2>/dev/null
563
- rm -rf "$rvm_ruby_gem_home/cache"
563
+ \rm -rf "$rvm_ruby_gem_home/cache"
564
564
  ln -nfs "$rvm_gems_cache_path" "$rvm_ruby_gem_home/cache"
565
565
  fi
566
566
  fi
@@ -12,11 +12,12 @@ args="$*"
12
12
 
13
13
  __rvm_attempt_single_exec() {
14
14
  # Return if we have multiple rubies. or we're not running exec.
15
- if [[ "$action" != "exec" ]] || $rvm_scripts_path/match "$rvm_ruby_strings" ' '; then
16
- return 1
15
+ local ruby_string_lines="$(printf "$rvm_ruby_strings" | wc -l | __rvm_strip)"
16
+ if [[ "$action" = "exec" && -n "$rvm_ruby_strings" && "$ruby_string_lines" = "0" ]]; then
17
+ __rvm_become "$rvm_ruby_strings"
18
+ eval "exec $args"
17
19
  fi
18
- __rvm_become "$rvm_ruby_strings"
19
- eval "exec $args"
20
+ return 1
20
21
  }
21
22
 
22
23
  # Perform an action using one of a selected ruby's specified binaries.
@@ -63,8 +64,8 @@ __rvm_ruby_do() {
63
64
  fi
64
65
 
65
66
  if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then
66
- mkdir -p ./log/$rvm_ruby_string/
67
- touch ./log/$rvm_ruby_string/$action.log ./log/$rvm_ruby_string/$action.error.log
67
+ \mkdir -p ./log/$rvm_ruby_string/
68
+ \touch ./log/$rvm_ruby_string/$action.log ./log/$rvm_ruby_string/$action.error.log
68
69
  eval "$rvm_command" >> ./log/$rvm_ruby_string/$action.log 2>> ./log/$rvm_ruby_string/$action.error.log
69
70
  else
70
71
  if [[ "$rvm_verbose_flag" != "0" ]] ; then
@@ -123,7 +124,7 @@ __rvm_yaml() {
123
124
  fi
124
125
  yaml="$yaml\n \"${rubies[$index]}\": ${statuses[$index]}"
125
126
  done ; unset index array_start
126
- mkdir -p log
127
+ \mkdir -p log
127
128
  printf "$yaml" | tee -a log/summary.yaml
128
129
 
129
130
  return ${#errors[*]}
@@ -148,7 +149,7 @@ __rvm_json() {
148
149
  done ; unset index array_start
149
150
  json="$json\n }\n}"
150
151
 
151
- mkdir -p log
152
+ \mkdir -p log
152
153
  printf "$json" | tee -a log/summary.json
153
154
 
154
155
  return ${#errors[*]}
@@ -24,20 +24,20 @@ snapshot_save() {
24
24
 
25
25
  # Create the temporary directory.
26
26
  local snapshot_temp_path="$rvm_tmp_path/$$-snapshot"
27
- rm -rf "$snapshot_temp_path"
28
- mkdir -p "$snapshot_temp_path"
27
+ \rm -rf "$snapshot_temp_path"
28
+ \mkdir -p "$snapshot_temp_path"
29
29
 
30
30
  $rvm_scripts_path/log "info" "Backing up a list of aliases"
31
- cp "$rvm_config_path/alias" "$snapshot_temp_path/"
31
+ \cp "$rvm_config_path/alias" "$snapshot_temp_path/"
32
32
 
33
33
  $rvm_scripts_path/log "info" "Backing up your user preferences"
34
- cp "$rvm_config_path/user" "$snapshot_temp_path/"
34
+ \cp "$rvm_config_path/user" "$snapshot_temp_path/"
35
35
 
36
36
  $rvm_scripts_path/log "info" "Backing up your installed packages"
37
37
  cat "$rvm_config_path/packages" | sed -e 's/-//' -e 's/^lib//' | awk -F= '{print $1}' | sort | uniq > "$snapshot_temp_path/packages"
38
38
 
39
39
  $rvm_scripts_path/log "info" "Backing up all of your gemsets"
40
- mkdir -p "$snapshot_temp_path/gems"
40
+ \mkdir -p "$snapshot_temp_path/gems"
41
41
  __rvm_pushpop "$snapshot_temp_path/gems"
42
42
  for snapshot_gemset in $($rvm_scripts_path/list gemsets strings) ; do
43
43
  __rvm_become "$snapshot_gemset"
@@ -46,8 +46,8 @@ snapshot_save() {
46
46
  $rvm_scripts_path/gemsets export "${snapshot_gemset}.gems" >/dev/null
47
47
  result="$?"
48
48
  __error_on_result "$result" "Error exporting gemset contents for $snapshot_gemset" && return "$result"
49
- mkdir -p "./$snapshot_gemset/"
50
- [[ -d "$GEM_HOME/cache/" ]] && cp -R "$GEM_HOME/cache/" "./$snapshot_gemset/"
49
+ \mkdir -p "./$snapshot_gemset/"
50
+ [[ -d "$GEM_HOME/cache/" ]] && \cp -R "$GEM_HOME/cache/" "./$snapshot_gemset/"
51
51
  done; unset snapshot_gemset
52
52
  __rvm_pushpop
53
53
 
@@ -61,7 +61,7 @@ snapshot_save() {
61
61
  $rvm_scripts_path/alias list | awk -F ' => ' '{print $1}' | sort | uniq 2>/dev/null > "$snapshot_alias_name_file"
62
62
  $rvm_scripts_path/list strings | \tr ' ' '\n' | sort | uniq > "$snapshot_ruby_name_file"
63
63
  comm -2 -3 "$snapshot_ruby_name_file" "$snapshot_alias_name_file" > "$snapshot_installable_file"
64
- rm -rf "$snapshot_ruby_name_file" "$snapshot_alias_name_file"
64
+ \rm -rf "$snapshot_ruby_name_file" "$snapshot_alias_name_file"
65
65
 
66
66
  local snapshot_primary_ruby="$(cat "$snapshot_installable_file" | grep '^\(ree\|ruby-1.8.7\)' | grep -v '-head$' | sort -r | head -n1)"
67
67
  local snapshot_ruby_order="$snapshot_primary_ruby $(cat "$snapshot_installable_file" | grep -v "$snapshot_primary_ruby")"
@@ -76,19 +76,19 @@ snapshot_save() {
76
76
  unset snapshot_install_command
77
77
  done; unset snapshot_ruby_name snapshot_primary_ruby
78
78
 
79
- rm -rf "$snapshot_installable_file"
79
+ \rm -rf "$snapshot_installable_file"
80
80
 
81
81
  $rvm_scripts_path/log "info" "Compressing snapshotting"
82
82
  local destination_path="$PWD"
83
83
  __rvm_pushpop "$snapshot_temp_path"
84
- rm -rf "$destination_path/$1.tar.gz"
84
+ \rm -rf "$destination_path/$1.tar.gz"
85
85
  tar czf "$destination_path/$1.tar.gz" .
86
86
  result="$?"
87
87
  __error_on_result "$result" "Error creating archive $destination_path/$1.tar.gz" && return "$result"
88
88
  __rvm_pushpop
89
89
 
90
90
  $rvm_scripts_path/log "info" "Cleaning up"
91
- rm -rf "$snapshot_temp_path"
91
+ \rm -rf "$snapshot_temp_path"
92
92
 
93
93
  $rvm_scripts_path/log "info" "Snapshot complete"
94
94
 
@@ -110,8 +110,8 @@ snapshot_load() {
110
110
 
111
111
  local snapshot_temp_path="$rvm_tmp_path/$$-snapshot"
112
112
 
113
- rm -rf "$snapshot_temp_path"
114
- mkdir -p "$snapshot_temp_path"
113
+ \rm -rf "$snapshot_temp_path"
114
+ \mkdir -p "$snapshot_temp_path"
115
115
 
116
116
  $rvm_scripts_path/log "info" "Extracting snapshot"
117
117
  __rvm_pushpop "$snapshot_temp_path"
@@ -121,7 +121,7 @@ snapshot_load() {
121
121
  __rvm_pushpop
122
122
 
123
123
  $rvm_scripts_path/log "info" "Restoring user settings"
124
- cp -f "$snapshot_temp_path/user" "$rvm_config_path/user"
124
+ \cp -f "$snapshot_temp_path/user" "$rvm_config_path/user"
125
125
 
126
126
  $rvm_scripts_path/log "info" "Installing rvm-managed packages"
127
127
  for snapshot_package in $(cat "$snapshot_temp_path/packages"); do
@@ -143,8 +143,8 @@ snapshot_load() {
143
143
  __rvm_become "$snapshot_gemset"
144
144
  result="$?"
145
145
  __error_on_result "$result" "Error becoming '$snapshot_gemset'" && return "$result"
146
- mkdir -p "$GEM_HOME/cache/"
147
- cp -Rf "$snapshot_gemset/" "$GEM_HOME/cache/"
146
+ \mkdir -p "$GEM_HOME/cache/"
147
+ \cp -Rf "$snapshot_gemset/" "$GEM_HOME/cache/"
148
148
  result="$?"
149
149
  __error_on_result "$result" "Error copying across cache for $snapshot_gemset" && return "$result"
150
150
  $rvm_scripts_path/gemsets import "$snapshot_gemset" >/dev/null 2>&1
@@ -167,7 +167,7 @@ snapshot_load() {
167
167
  unset package_info
168
168
 
169
169
  $rvm_scripts_path/log "info" "Cleaning up load process"
170
- rm -rf "$snapshot_temp_path"
170
+ \rm -rf "$snapshot_temp_path"
171
171
 
172
172
  $rvm_scripts_path/log "info" "Loaded snapshot from $(basename "$snapshot_archive")"
173
173
  }