rvm 0.1.45 → 0.1.46

Sign up to get free protection for your applications and to get access to all the features.
data/scripts/db CHANGED
@@ -10,8 +10,8 @@ usage() {
10
10
  if [[ -f "$1" ]] ; then
11
11
  database_file="$1" ; shift
12
12
  if [[ ! -f "$database_file" ]] ; then
13
- mkdir -p $(dirname $database_file)
14
- touch $database_file
13
+ \mkdir -p $(dirname $database_file)
14
+ \touch $database_file
15
15
  fi
16
16
  else
17
17
  printf "\n\nDatabase file $1 does not exist.\n\n" >&2
@@ -12,7 +12,7 @@ rvm_docs_type="${rvm_docs_type:-rdoc}"
12
12
 
13
13
  # Ensure we have the doc directories.
14
14
  if [[ ! -d "$rvm_docs_path" ]] ; then
15
- mkdir -p "$rvm_docs_path/rdoc" "$rvm_docs_path/yard"
15
+ \mkdir -p "$rvm_docs_path/rdoc" "$rvm_docs_path/yard"
16
16
  fi
17
17
 
18
18
  usage() {
@@ -45,7 +45,7 @@ generate_ri() {
45
45
 
46
46
  generate_rdoc() {
47
47
  __rvm_pushpop "$rvm_src_path/$rvm_docs_ruby_string/"
48
- rm -rf "$rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type/"
48
+ \rm -rf "$rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type/"
49
49
  $rvm_scripts_path/log "info" "Generating rdoc documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."
50
50
  $rvm_scripts_path/log "info" "( Errors will be logged to $rvm_log_path/$rvm_docs_ruby_string/docs.error.log )"
51
51
  if gem list | grep -q ^hanna ; then
@@ -8,7 +8,7 @@ result=0
8
8
  trap 'cleanup_download' 1 2 3 15
9
9
 
10
10
  cleanup_download() {
11
- [[ -f "$archive" ]] && rm -rf "$archive"
11
+ [[ -f "$archive" ]] && \rm -rf "$archive"
12
12
  }
13
13
 
14
14
  record_md5() {
@@ -66,7 +66,7 @@ fi
66
66
  http_url="$(echo $url | sed -e 's/ftp:/http:/' -e 's/git:/http:/')"
67
67
 
68
68
  if [[ $download -gt 0 ]] ; then
69
- rm -f $archive
69
+ \rm -f $archive
70
70
  eval $fetch_command "$url"
71
71
  result=$?
72
72
  if [[ $result -gt 0 ]] ; then
@@ -77,11 +77,11 @@ if [[ $download -gt 0 ]] ; then
77
77
  try_http=1
78
78
  elif [[ $result -eq 18 ]] ; then
79
79
  $rvm_scripts_path/log "error" "Partial file. Only a part of the file was transferred. Removing partial and re-trying."
80
- rm -f "$archive"
80
+ \rm -f "$archive"
81
81
  retry=1
82
82
  elif [[ $result -eq 33 ]] ; then
83
83
  if [[ ! -z "$rvm_debug_flag" ]] ; then $rvm_scripts_path/log "debug" "Server does not support 'range' command, removing '$archive'" ; fi
84
- rm -f "$archive"
84
+ \rm -f "$archive"
85
85
  retry=1
86
86
  else
87
87
  $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log. Next we'll try to fetch via http."
@@ -43,20 +43,20 @@ gemset_globalcache() {
43
43
  current_cache_path="$rvm_gems_path/$directory_name/cache"
44
44
  if [[ -L "$current_cache_path" && "$(readlink "$current_cache_path")" == "$rvm_gems_cache_path" ]]; then
45
45
  $rvm_scripts_path/log "info" "Reverting the gem cache for $directory_name to an empty directory."
46
- rm -f "$current_cache_path" 2>/dev/null
47
- mkdir -p "$current_cache_path" 2>/dev/null
46
+ \rm -f "$current_cache_path" 2>/dev/null
47
+ \mkdir -p "$current_cache_path" 2>/dev/null
48
48
  fi
49
49
  done; unset full_directory_path directory_name
50
50
  $rvm_scripts_path/db "$rvm_config_path/user" "use_gemset_globalcache" "delete"
51
51
  elif [[ "$1" == "enable" ]]; then
52
52
  $rvm_scripts_path/log "info" "Enabling global cache for gems."
53
- mkdir -p "$rvm_gems_cache_path"
53
+ \mkdir -p "$rvm_gems_cache_path"
54
54
  for directory_name in $(\ls "$rvm_gems_path"); do
55
55
  current_cache_path="$rvm_gems_path/$directory_name/cache"
56
56
  if [[ -d "$current_cache_path" && ! -L "$current_cache_path" ]]; then
57
57
  $rvm_scripts_path/log "info" "Moving the gem cache for $directory_name to the global cache."
58
58
  mv "$current_cache_path/"*.gem "$rvm_gems_cache_path/" 2>/dev/null
59
- rm -rf "$current_cache_path"
59
+ \rm -rf "$current_cache_path"
60
60
  ln -nfs "$rvm_gems_cache_path" "$current_cache_path"
61
61
  fi
62
62
  done; unset full_directory_path directory_name
@@ -80,12 +80,12 @@ gemset_create() {
80
80
  rvm_ruby_gem_prefix=$(echo $rvm_ruby_gem_home | sed 's/'${rvm_gemset_separator}'.*$//')
81
81
  for gemset in $(echo $gems_args) ; do
82
82
  gem_home="${rvm_ruby_gem_prefix}${rvm_gemset_separator}${gemset}"
83
- mkdir -p "$gem_home"
83
+ \mkdir -p "$gem_home"
84
84
  # When the globalcache is enabled, we need to ensure we setup the cache directory correctly.
85
85
  if __rvm_using_gemset_globalcache; then
86
86
  if [[ -d "$gem_home/cache" && ! -L "$gem_home/cache" ]]; then
87
87
  mv "$gem_home/cache"/*.gem "$rvm_gems_cache_path/" 2>/dev/null
88
- rm -rf "$gem_home/cache"
88
+ \rm -rf "$gem_home/cache"
89
89
  fi
90
90
  ln -nfs "$rvm_gems_cache_path" "$gem_home/cache"
91
91
  fi
@@ -114,14 +114,14 @@ gemset_delete() {
114
114
  if [[ ! -z "$rvm_gemset_name" ]] ; then
115
115
  gemdir="$rvm_gems_path/$rvm_ruby_string${rvm_gemset_separator}$rvm_gemset_name"
116
116
  if [[ -d "$gemdir" ]] && [[ "$gemdir" != '/' ]] && [[ ! -z "$rvm_force_flag" ]] ; then
117
- rm -rf "$gemdir"
117
+ \rm -rf "$gemdir"
118
118
  elif [[ -d "$gemdir" ]] ; then
119
119
  $rvm_scripts_path/log "warn" "Are you SURE you wish to remove the entire gemset directory '$rvm_gemset_name' ($gemdir)?"
120
120
  echo -n "(anything other than 'yes' will cancel) > "
121
121
  read response
122
122
  if [[ "yes" = "$response" ]] ; then
123
- rm -f $gemdir/cache 2>/dev/null
124
- rm -rf $gemdir
123
+ \rm -f $gemdir/cache 2>/dev/null
124
+ \rm -rf $gemdir
125
125
  else
126
126
  $rvm_scripts_path/log "info" "Not doing anything, phew... close call that one eh?"
127
127
  fi
@@ -137,13 +137,13 @@ gemset_empty() {
137
137
  if [[ -z "$rvm_ruby_gem_home" ]] ; then __rvm_select ; fi
138
138
  gemdir="$rvm_ruby_gem_home"
139
139
  if [[ -d "$gemdir" ]] && [[ "$gemdir" != '/' ]] && [[ ! -z "$rvm_force_flag" ]] ; then
140
- builtin cd $gemdir && rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
140
+ builtin cd $gemdir && \rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
141
141
  elif [[ -d "$gemdir" ]] ; then
142
142
  $rvm_scripts_path/log "warn" "Are you SURE you wish to remove the installed gemset for gemset '$(basename $gemdir)' ($gemdir)?"
143
143
  echo -n "(anything other than 'yes' will cancel) > "
144
144
  read response
145
145
  if [[ "yes" = "$response" ]] ; then
146
- builtin cd $gemdir && rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
146
+ builtin cd $gemdir && \rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
147
147
  else
148
148
  $rvm_scripts_path/log "info" "Not doing anything, phew... close call that one eh?"
149
149
  fi
@@ -156,31 +156,31 @@ gemset_empty() {
156
156
  gemset_copy() {
157
157
  local source_ruby="$(echo "$gems_args" | awk '{print $1}')"
158
158
  local destination_ruby="$(echo "$gems_args" | awk '{print $2}')"
159
-
159
+
160
160
  if [[ -z "$destination_ruby" || -z "$source_ruby" ]] ; then
161
161
  $rvm_scripts_path/log "error" "Source and destination must be specified: 'rvm gemset copy X Y'"
162
162
  return 1
163
163
  fi
164
-
164
+
165
165
  local source_path="$(rvm_silence_logging=1 rvm "$source_ruby" gem env gemdir)"
166
166
  local destination_path="$(rvm_silence_logging=1 rvm "$destination_ruby" gem env gemdir)"
167
-
167
+
168
168
  if [[ -z "$source_path" ]]; then
169
169
  $rvm_scripts_path/log "error" "Unable to expand ruby '$source_ruby'"
170
170
  return 1
171
171
  fi
172
-
172
+
173
173
  if [[ -z "$destination_path" ]]; then
174
174
  $rvm_scripts_path/log "error" "Unable to expand ruby '$destination_ruby'"
175
175
  return 1
176
176
  fi
177
-
177
+
178
178
  if [[ -d "$source_path" ]] ; then
179
- [[ ! -d "$destination_path" ]] && mkdir -p "$destination_path"
179
+ [[ ! -d "$destination_path" ]] && \mkdir -p "$destination_path"
180
180
  $rvm_scripts_path/log "info" "Copying gemset from $source_ruby to $destination_ruby"
181
181
  for dir in bin doc gems specifications cache ; do
182
- mkdir -p "$destination_path/$dir"
183
- cp -Rf "$source_path/$dir" "$destination_path/"
182
+ \mkdir -p "$destination_path/$dir"
183
+ \cp -Rf "$source_path/$dir" "$destination_path/"
184
184
  done
185
185
  $rvm_scripts_path/log "info" "Making gemset for $destination_ruby pristine."
186
186
  __rvm_run_with_env "gemset.pristine" "$destination_ruby" "rvm gemset pristine"
@@ -209,7 +209,7 @@ gemset_export() {
209
209
 
210
210
  $rvm_scripts_path/log "info" "Exporting current environments gemset to $rvm_file_name"
211
211
 
212
- touch $rvm_file_name
212
+ \touch $rvm_file_name
213
213
  echo "# $rvm_file_name generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator" > $rvm_file_name
214
214
  for gem in $(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | \tr ' ' ';') ; do
215
215
  name="$(echo $gem | awk -F';' '{print $1}')"
@@ -251,7 +251,7 @@ gemset_import() {
251
251
  return 1
252
252
  fi
253
253
 
254
- mkdir -p "$rvm_gems_cache_path" # Ensure the base cache dir is initialized.
254
+ \mkdir -p "$rvm_gems_cache_path" # Ensure the base cache dir is initialized.
255
255
 
256
256
  if [[ -s "$rvm_file_name" ]] ; then
257
257
  echo "Importing $rvm_file_name file..."
@@ -335,7 +335,7 @@ gem_install() {
335
335
  $rvm_scripts_path/log "info" "$gem_name $gem_version exists, skipping (--force to re-install)"
336
336
  else
337
337
  if [[ -s "$(__rvm_current_gemcache_dir)/$(basename $gem_file_name)" ]] ; then
338
- mkdir -p "$rvm_tmp_path/$$/"
338
+ \mkdir -p "$rvm_tmp_path/$$/"
339
339
  mv "$(__rvm_current_gemcache_dir)/$gem_file_name" "$rvm_tmp_path/$$/$gem_file_name"
340
340
  gem="$rvm_tmp_path/$$/$gem_file_name -f -l"
341
341
  else
@@ -386,7 +386,7 @@ gemset_info() {
386
386
  gemset_prune() {
387
387
  temporary_cache_path="$GEM_HOME/temporary-cache"
388
388
  live_cache_path="$GEM_HOME/cache"
389
- mkdir -p "$temporary_cache_path"
389
+ \mkdir -p "$temporary_cache_path"
390
390
  $rvm_scripts_path/log "info" "Moving active gems into temporary cache..."
391
391
  while read -r used_gem; do
392
392
  gem_name="$(echo "$used_gem" | sed -e 's/ .*//')"
@@ -401,7 +401,7 @@ gemset_prune() {
401
401
  done < <(gem list --versions)
402
402
  $rvm_scripts_path/log "info" "Removing live cache and restoring temporary cache..."
403
403
  # Switch the cache back.
404
- rm -rf "$live_cache_path"
404
+ \rm -rf "$live_cache_path"
405
405
  mv "$temporary_cache_path" "$live_cache_path"
406
406
  }
407
407
 
@@ -412,7 +412,7 @@ gemset_pristine() {
412
412
  # Loads the default gemsets for the current interpreter and gemset.
413
413
  gemset_initial() {
414
414
  $rvm_scripts_path/log "info" "Importing initial gemsets for $(__rvm_environment_identifier)."
415
- mkdir -p "$rvm_gemsets_path/$(echo "$rvm_ruby_string" | \tr '-' '/')" 2>/dev/null
415
+ \mkdir -p "$rvm_gemsets_path/$(echo "$rvm_ruby_string" | \tr '-' '/')" 2>/dev/null
416
416
  for gemsets_path in $(__rvm_ruby_string_paths_under "$rvm_gemsets_path") ; do
417
417
  if [[ -n "$rvm_gemset_name" ]] ; then
418
418
  if [[ -s "${gemsets_path}/${rvm_gemset_name}.gems" ]] ; then
@@ -8,15 +8,9 @@ rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
8
8
  if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then rvm_ruby_gem_home="$(gem env home)" ; fi
9
9
 
10
10
  info_system() {
11
- rvm_info="$rvm_info\n system:\n uname: \"$(uname -a)\""
12
-
13
- if [[ ! -z "$ZSH_VERSION" ]] ; then
14
- rvm_info="$rvm_info\n shell: \"zsh\"\n version: \"$ZSH_VERSION\""
15
- fi
16
-
17
- if [[ ! -z "$BASH_VERSION" ]] ; then
18
- rvm_info="$rvm_info\n shell: \"bash\"\n version: \"$BASH_VERSION\""
19
- fi
11
+ rvm_info="$rvm_info\n system:\n uname: \"$(uname -a)\""
12
+ rvm_info="$rvm_info\n zsh: \"$(zsh --version)\""
13
+ rvm_info="$rvm_info\n bash: \"$(bash --version | head -n 1)\""
20
14
  rvm_info="$rvm_info\n"
21
15
  }
22
16
 
@@ -3,8 +3,8 @@
3
3
  rvm_selfcontained="${rvm_selfcontained:-1}"
4
4
 
5
5
  if [[ "$rvm_selfcontained" = "0" ]] ; then
6
- rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
7
- rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
6
+ rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
7
+ rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}"
8
8
  rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
9
9
  else
10
10
  rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
@@ -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"
@@ -35,7 +35,7 @@ list_gemsets() {
35
35
  done ; unset version
36
36
 
37
37
  if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
38
- version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename)
38
+ version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n1 | awk -F"'" '{print $2}' | xargs basename)
39
39
  if [[ ! -z "$version" ]] ; then
40
40
  printf "\n\nDefault Ruby (for new shells)\n"
41
41
  string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
@@ -81,7 +81,7 @@ list_strings() {
81
81
  # This is meant to be used with scripting.
82
82
  list_gemset_strings() {
83
83
  local all_rubies="$(list_strings)"
84
- for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -- basename | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
84
+ for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -n1 basename | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
85
85
  local ruby_name="$(echo "$gemset" | awk -F$rvm_gemset_separator '{print $1}')"
86
86
  [[ "$all_rubies" != *"$ruby_name"* ]] && continue
87
87
  echo "$gemset"
@@ -67,7 +67,7 @@ __rvm_install_source() {
67
67
 
68
68
  $rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
69
69
  __rvm_pushpop "$rvm_src_path"
70
- if [[ -n "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
70
+ if [[ -n "$rvm_force_flag" ]] ; then \rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
71
71
 
72
72
  result=0
73
73
  __rvm_fetch_ruby
@@ -124,7 +124,7 @@ __rvm_install_source() {
124
124
  $rvm_scripts_path/log "error" "There has been an error while running make. Aborting the installation." ; __rvm_pushpop ; return $result
125
125
  fi
126
126
 
127
- if [[ -d .ext/rdoc ]] ; then rm -rf .ext/rdoc ; fi
127
+ if [[ -d .ext/rdoc ]] ; then \rm -rf .ext/rdoc ; fi
128
128
 
129
129
  rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
130
130
  __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
@@ -184,7 +184,7 @@ __rvm_install_ruby() {
184
184
  fi
185
185
  mv "$rvm_archives_path/macruby_nightly-latest.pkg" "$rvm_archives_path/macruby_nightly.pkg"
186
186
  __rvm_run "macruby/extract" "sudo /usr/sbin/installer -pkg '$rvm_archives_path/macruby_nightly.pkg' -target '/'"
187
- mkdir -p "$rvm_ruby_home/bin"
187
+ \mkdir -p "$rvm_ruby_home/bin"
188
188
  else
189
189
  macruby_path="/Library/Frameworks/MacRuby.framework/Versions/${rvm_ruby_version}/usr/bin"
190
190
  # TODO: Separated nightly from head.
@@ -193,11 +193,11 @@ __rvm_install_ruby() {
193
193
  result=$? ; if [[ "$result" -gt 0 ]] ; then
194
194
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
195
195
  fi
196
- mkdir -p $rvm_ruby_src_path
196
+ \mkdir -p $rvm_ruby_src_path
197
197
  unzip -o -j "$rvm_archives_path/$rvm_ruby_package_file" "MacRuby ${rvm_ruby_version}/MacRuby ${rvm_ruby_version}.pkg" -d "$rvm_ruby_src_path"
198
198
  mv "$rvm_ruby_src_path/MacRuby ${rvm_ruby_version}.pkg" "$rvm_ruby_src_path/$rvm_ruby_string.pkg"
199
199
  __rvm_run "macruby/extract" "sudo /usr/sbin/installer -pkg '$rvm_ruby_src_path/$rvm_ruby_string.pkg' -target '/'"
200
- mkdir -p "$rvm_ruby_home/bin"
200
+ \mkdir -p "$rvm_ruby_home/bin"
201
201
  fi
202
202
 
203
203
  binaries=(erb gem irb rake rdoc ri ruby testrb)
@@ -216,7 +216,7 @@ RubyWrapper
216
216
  )
217
217
 
218
218
  file_name="$rvm_ruby_home/bin/$binary_name"
219
- rm -f $file_name
219
+ \rm -f $file_name
220
220
  echo "$ruby_wrapper" > $file_name
221
221
  if [[ -f $file_name ]] ; then chmod +x $file_name ; fi
222
222
  if [[ "$binary_name" = "ruby" ]] ; then
@@ -244,7 +244,7 @@ RubyWrapper
244
244
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
245
245
  fi
246
246
 
247
- rm -rf "$rvm_ruby_src_path"
247
+ \rm -rf "$rvm_ruby_src_path"
248
248
  __rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
249
249
 
250
250
  result=$? ; if [[ "$result" -gt 0 ]] ; then
@@ -255,7 +255,7 @@ RubyWrapper
255
255
  fi
256
256
  builtin cd "$rvm_ruby_src_path"
257
257
 
258
- mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
258
+ \mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
259
259
  if [[ -n "$rvm_ruby_configure_flags" ]] ; then
260
260
  rvm_ruby_configure_flags="$(echo $rvm_ruby_configure_flags | sed 's#--#-c --#g')"
261
261
  fi
@@ -321,7 +321,7 @@ RubyWrapper
321
321
  fi
322
322
 
323
323
  # Remove the left over folder first.
324
- rm -rf "$rvm_ruby_src_path"
324
+ \rm -rf "$rvm_ruby_src_path"
325
325
  mv "$rvm_src_path/rubinius-${rvm_ruby_version}" "$rvm_ruby_src_path"
326
326
  else
327
327
  __rvm_db "rubinius_repo_url" "rvm_ruby_repo_url"
@@ -374,14 +374,14 @@ RubyWrapper
374
374
 
375
375
  # Install IRB Wrapper on Rubinius.
376
376
  file_name="$rvm_ruby_home/bin/irb"
377
- rm -f "$file_name"
377
+ \rm -f "$file_name"
378
378
  printf '#!/usr/bin/env bash\n' > "$file_name"
379
379
  printf "exec '$rvm_ruby_home/bin/rbx' 'irb' \"\$@\"\n" >> "$file_name"
380
380
  [[ -f "$file_name" ]] && chmod +x "$file_name"
381
381
 
382
382
  # Install Gem Wrapper on Rubinius.
383
383
  file_name="$rvm_ruby_home/bin/gem"
384
- cp -f "$rvm_ruby_home/lib/bin/gem.rb" "$file_name"
384
+ \cp -f "$rvm_ruby_home/lib/bin/gem.rb" "$file_name"
385
385
  __rvm_inject_ruby_shebang "$file_name"
386
386
  [[ -f "$file_name" ]] && chmod +x "$file_name"
387
387
  unset file_name
@@ -406,7 +406,7 @@ RubyWrapper
406
406
  builtin cd "$rvm_ruby_src_path"
407
407
  if [[ -n "$rvm_head_flag" ]] ; then __rvm_run "ant.dist" "ant dist" "Running 'ant dist' (this could take a few minutes) ..." ; fi
408
408
 
409
- mkdir -p "$rvm_ruby_home/bin/"
409
+ \mkdir -p "$rvm_ruby_home/bin/"
410
410
  if $rvm_scripts_path/match "$rvm_ruby_version" "1\.3" || $rvm_scripts_path/match "$rvm_ruby_version" "1\.2" ; then
411
411
  __rvm_run "nailgun" "builtin cd \"$rvm_ruby_src_path/tool/nailgun\" && make $rvm_make_flags" "Building Nailgun"
412
412
  else
@@ -417,7 +417,7 @@ RubyWrapper
417
417
 
418
418
  if [[ -z "$rvm_ruby_home" ]] || [[ "$rvm_ruby_home" = "/" ]] ; then echo "WTH?!?! rvm_ruby_home == / ??? not removing." ; return 1000000 ; fi
419
419
 
420
- rm -rf $rvm_ruby_home
420
+ \rm -rf $rvm_ruby_home
421
421
  __rvm_run "install" "/bin/cp -Rf $rvm_ruby_src_path $rvm_ruby_home" "Installing JRuby to $rvm_ruby_home"
422
422
 
423
423
  __rvm_pushpop $rvm_ruby_home/bin/
@@ -461,7 +461,7 @@ RubyWrapper
461
461
  __rvm_pushpop $rvm_src_path
462
462
 
463
463
  if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ -n "$rvm_force_flag" ]] ; then
464
- rm -rf "$rvm_src_path/$rvm_ruby_string/" "$rvm_src_path/$rvm_ruby_string/"
464
+ \rm -rf "$rvm_src_path/$rvm_ruby_string/" "$rvm_src_path/$rvm_ruby_string/"
465
465
  __rvm_fetch_ruby
466
466
  result=$? ; if [[ "$result" -gt 0 ]] ; then
467
467
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
@@ -499,7 +499,7 @@ RubyWrapper
499
499
  __rvm_pushpop
500
500
 
501
501
  if [[ -z "$rvm_ruby_home" ]] || [[ "$rvm_ruby_home" = "/" ]] ; then echo "WTH?!?! rvm_ruby_home == / ??? not removing." ; return 1000000 ; fi
502
- rm -rf $rvm_ruby_home
502
+ \rm -rf $rvm_ruby_home
503
503
  __rvm_run "install" "/bin/cp -Rf $rvm_ruby_src_path $rvm_ruby_home" "Installing maglev to $rvm_ruby_home"
504
504
 
505
505
  __rvm_pushpop $rvm_ruby_home/bin/
@@ -579,13 +579,13 @@ RubyWrapper
579
579
  unset compatible_ruby
580
580
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
581
581
 
582
- rm -rf $rvm_ruby_home/*
583
- mkdir -p $rvm_ruby_home/bin $rvm_ruby_home/lib $rvm_ruby_home/lib/ruby $rvm_ruby_home/lib/IronRuby
582
+ \rm -rf $rvm_ruby_home/*
583
+ \mkdir -p $rvm_ruby_home/bin $rvm_ruby_home/lib $rvm_ruby_home/lib/ruby $rvm_ruby_home/lib/IronRuby
584
584
 
585
- cp -r $rvm_ruby_src_path/Merlin/Main/Bin/mono_release/* $rvm_ruby_home/bin/
586
- cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/
587
- cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/* $rvm_ruby_home/lib/ruby
588
- cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs/* $rvm_ruby_home/lib/IronRuby
585
+ \cp -r $rvm_ruby_src_path/Merlin/Main/Bin/mono_release/* $rvm_ruby_home/bin/
586
+ \cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/
587
+ \cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/* $rvm_ruby_home/lib/ruby
588
+ \cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs/* $rvm_ruby_home/lib/IronRuby
589
589
  else
590
590
  $rvm_scripts_path/log "info" "Retrieving IronRuby"
591
591
 
@@ -594,14 +594,14 @@ RubyWrapper
594
594
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
595
595
  fi
596
596
 
597
- mkdir -p $rvm_ruby_src_path $rvm_ruby_home
597
+ \mkdir -p $rvm_ruby_src_path $rvm_ruby_home
598
598
  unzip -o -d ${rvm_ruby_src_path} ${rvm_archives_path}/${rvm_ruby_package_file} >> "$rvm_ruby_log_path/extract.log" 2>> "$rvm_ruby_log_path/extract.error.log"
599
599
  result=$? ; if [[ "$result" -gt 1 ]] ; then
600
600
  $rvm_scripts_path/log "error" "There has been an error while trying to extract $rvm_ruby_package_file. Aborting the installation." ; __rvm_pushpop ; return $result
601
601
  fi
602
602
 
603
603
  for dir in bin lib silverlight ; do
604
- cp -Rf $rvm_src_path/$rvm_ruby_string/$dir "$rvm_ruby_home/$dir"
604
+ \cp -Rf $rvm_src_path/$rvm_ruby_string/$dir "$rvm_ruby_home/$dir"
605
605
  done
606
606
  fi
607
607
 
@@ -711,9 +711,9 @@ RubyWrapper
711
711
  }
712
712
 
713
713
  __rvm_fetch_from_github() {
714
- rm -rf "$rvm_ruby_src_path"
714
+ \rm -rf "$rvm_ruby_src_path"
715
715
  if [[ ! -d "$rvm_ruby_repo_path/.git" ]] ; then
716
- rm -rf "$rvm_ruby_repo_path"
716
+ \rm -rf "$rvm_ruby_repo_path"
717
717
  builtin cd "$rvm_home"
718
718
  __rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_url"
719
719
  result=$? ; if [[ "$result" -gt 0 ]] ; then
@@ -726,7 +726,7 @@ __rvm_fetch_from_github() {
726
726
  builtin cd "$rvm_ruby_repo_path"
727
727
  __rvm_run "$1.repo" "git pull origin $branch" "Pulling from origin $branch"
728
728
  fi
729
- __rvm_run "$1.copy" "cp -R \"$rvm_ruby_repo_path\" \"$rvm_ruby_src_path\"" "Copying from repo to source..."
729
+ __rvm_run "$1.copy" "\\cp -R \"$rvm_ruby_repo_path\" \"$rvm_ruby_src_path\"" "Copying from repo to source..."
730
730
  builtin cd "$rvm_ruby_src_path"
731
731
  }
732
732
 
@@ -758,9 +758,9 @@ __rvm_fetch_ruby() {
758
758
  fi
759
759
 
760
760
  if [[ ! -d "$rvm_ruby_src_path" ]] || [[ -n "$rvm_force_flag" ]] ; then
761
- rm -rf "$rvm_ruby_src_path" # Especially when forced, we want to ensure the destination is missing.
761
+ \rm -rf "$rvm_ruby_src_path" # Especially when forced, we want to ensure the destination is missing.
762
762
 
763
- mkdir -p "/tmp/rvm_src_$$"
763
+ \mkdir -p "/tmp/rvm_src_$$"
764
764
 
765
765
  if [[ "tar.gz" = "$rvm_archive_extension" ]] || [[ "tgz" = "$rvm_archive_extension" ]] ; then
766
766
  __rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | gunzip | tar xf - -C /tmp/rvm_src_$$" "Extracting $rvm_ruby_package_file ..."
@@ -774,7 +774,7 @@ __rvm_fetch_ruby() {
774
774
  fi
775
775
  fi
776
776
 
777
- mv "/tmp/rvm_src_$$/$(\cd /tmp/rvm_src_$$ ; \ls)" "$rvm_ruby_src_path" ; rm -rf "/tmp/rvm_src_$$"
777
+ mv "/tmp/rvm_src_$$/$(\cd /tmp/rvm_src_$$ ; \ls)" "$rvm_ruby_src_path" ; \rm -rf "/tmp/rvm_src_$$"
778
778
 
779
779
  if [[ -n "$rvm_ruby_name" ]] && [[ -d "$rvm_src_path/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" ]] ; then
780
780
  mv "$rvm_src_path/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" "$rvm_ruby_src_path"
@@ -786,7 +786,7 @@ __rvm_fetch_ruby() {
786
786
 
787
787
  else
788
788
 
789
- mkdir -p "$rvm_repo_path"
789
+ \mkdir -p "$rvm_repo_path"
790
790
  if [[ -n "$(echo $rvm_url | awk '/^git/')" ]] ; then
791
791
  if [[ -d "$rvm_ruby_repo_path/.git" ]] ; then
792
792
  builtin cd $rvm_ruby_repo_path
@@ -807,7 +807,7 @@ __rvm_fetch_ruby() {
807
807
  fi
808
808
  fi
809
809
  else
810
- rm -rf "$rvm_ruby_repo_path"
810
+ \rm -rf "$rvm_ruby_repo_path"
811
811
  rvm_ruby_repo_http_url="$(echo $rvm_ruby_repo_url | sed -e 's/git:/http:/')"
812
812
  $rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
813
813
  git clone --depth 1 "$rvm_ruby_repo_url" "$rvm_ruby_repo_path"
@@ -852,7 +852,7 @@ __rvm_fetch_ruby() {
852
852
  __rvm_run "svn.checkout" "svn update -q ${rvm_rev/-r/-r }"
853
853
  fi
854
854
  else
855
- rm -rf $rvm_ruby_repo_path
855
+ \rm -rf $rvm_ruby_repo_path
856
856
  __rvm_run "svn.checkout" "svn checkout -q ${rvm_rev/-r/-r } $rvm_url $rvm_ruby_repo_path" "Downloading source from ${rvm_url}."
857
857
  fi
858
858
  result=$? ; if [[ "$result" -gt 0 ]] ; then
@@ -861,8 +861,8 @@ __rvm_fetch_ruby() {
861
861
 
862
862
  fi
863
863
  $rvm_scripts_path/log "info" "Copying from repo to src path..."
864
- rm -rf "$rvm_ruby_src_path"
865
- cp -R "$rvm_ruby_repo_path" "$rvm_ruby_src_path"
864
+ \rm -rf "$rvm_ruby_src_path"
865
+ \cp -R "$rvm_ruby_repo_path" "$rvm_ruby_src_path"
866
866
  fi
867
867
  }
868
868
 
@@ -882,12 +882,12 @@ __rvm_uninstall_ruby() {
882
882
  for dir in $rvm_rubies_path ; do
883
883
  if [[ -d $dir/$rvm_ruby_string ]] ; then
884
884
  $rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
885
- rm -rf $dir/$rvm_ruby_string
885
+ \rm -rf $dir/$rvm_ruby_string
886
886
  else
887
887
  $rvm_scripts_path/log "info" "$dir/$rvm_ruby_string has already been removed."
888
888
  fi
889
889
  if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
890
- rm -f $rvm_bin_path/$rvm_ruby_string
890
+ \rm -f $rvm_bin_path/$rvm_ruby_string
891
891
  fi
892
892
  done ; unset dir
893
893
 
@@ -909,13 +909,13 @@ __rvm_remove_ruby() {
909
909
  for dir in $rvm_src_path $rvm_rubies_path ; do
910
910
  if [[ -d $dir/$rvm_ruby_string ]] ; then
911
911
  $rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
912
- rm -rf $dir/$rvm_ruby_string
912
+ \rm -rf $dir/$rvm_ruby_string
913
913
  else
914
914
  $rvm_scripts_path/log "info" "it seems that $dir/$rvm_ruby_string is already non existent."
915
915
  fi
916
916
 
917
917
  if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
918
- rm -f $rvm_bin_path/$rvm_ruby_string
918
+ \rm -f $rvm_bin_path/$rvm_ruby_string
919
919
  fi
920
920
 
921
921
  __rvm_check_default
@@ -939,7 +939,7 @@ __rvm_remove_gemsets() {
939
939
  gemsets="$rvm_gems_path/$rvm_ruby_string $(\ls -d "${rvm_gems_path}"/* | awk '/'$rvm_ruby_string'@/')"
940
940
  for gemset in $gemsets ; do
941
941
  if [[ -d "$gemset" ]] ; then
942
- rm -rf "$gemset"
942
+ \rm -rf "$gemset"
943
943
  fi
944
944
  done ; unset gemset gemsets
945
945
  fi
@@ -949,7 +949,7 @@ __rvm_remove_wrappers() {
949
949
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string wrappers..."
950
950
  wrappers="$rvm_wrappers_path/$rvm_ruby_string $(\ls -d "$rvm_wrappers_path"/* 2>/dev/null | awk '/'$rvm_ruby_string'@/')"
951
951
  for wrapper in $wrappers ; do
952
- rm -rf "$wrapper"
952
+ \rm -rf "$wrapper"
953
953
  done ; unset wrapper wrappers
954
954
  }
955
955
 
@@ -957,7 +957,7 @@ __rvm_remove_environments() {
957
957
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string environments..."
958
958
  environments="$rvm_environments_path/$rvm_ruby_string $(\ls -d "$rvm_environments_path"/* | awk '/'$rvm_ruby_string'@/')"
959
959
  for environment in $environments ; do
960
- rm -rf "$environment"
960
+ \rm -rf "$environment"
961
961
  done ; unset environment environments
962
962
  }
963
963
 
@@ -973,7 +973,7 @@ __rvm_remove_aliases() {
973
973
  __rvm_remove_archives() {
974
974
  if [[ -n "$rvm_archive_flag" ]] ; then
975
975
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string archives..."
976
- rm -f $rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}
976
+ \rm -f $rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}
977
977
  fi
978
978
  }
979
979
 
@@ -983,7 +983,7 @@ __rvm_remove_binaries() {
983
983
  for binary_name in $(\ls "$rvm_bin_path"); do
984
984
  full_binary_path="$rvm_bin_path/$binary_name"
985
985
  if [[ -L "$full_binary_path" ]] && $rvm_scripts_path/match "$(readlink "$full_binary_path")" "$rvm_ruby_string"; then
986
- rm -f "$full_binary_path"
986
+ \rm -f "$full_binary_path"
987
987
  fi
988
988
  unset full_binary_path
989
989
  done; unset binary_name
@@ -996,9 +996,9 @@ __rvm_post_install() {
996
996
  for binary in $(echo $binaries) ; do
997
997
  if [[ -e "$rvm_ruby_home/bin/$binary" ]] || [[ -e "$rvm_ruby_src_path/bin/$binary" ]] ; then
998
998
  if [[ "$rvm_ruby_src_path" != "$rvm_ruby_home" ]] && [[ -f "$rvm_ruby_src_path/bin/$binary" ]] ; then
999
- cp -f "$rvm_ruby_src_path/bin/$binary" "$rvm_ruby_home/bin/$binary"
999
+ \cp -f "$rvm_ruby_src_path/bin/$binary" "$rvm_ruby_home/bin/$binary"
1000
1000
  elif [[ -f "$rvm_ruby_gem_home/bin/$binary" ]] ; then
1001
- cp -f "$rvm_ruby_gem_home/bin/$binary" "$rvm_ruby_home/bin/$binary"
1001
+ \cp -f "$rvm_ruby_gem_home/bin/$binary" "$rvm_ruby_home/bin/$binary"
1002
1002
  fi
1003
1003
  __rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
1004
1004
  __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$binary"
@@ -1046,7 +1046,7 @@ __rvm_rubygems_setup() {
1046
1046
  __rvm_inject_ruby_shebang "$rvm_ruby_src_path/bin/gem"
1047
1047
  __rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
1048
1048
 
1049
- cp $rvm_ruby_src_path/bin/gem $rvm_ruby_home/bin/gem
1049
+ \cp $rvm_ruby_src_path/bin/gem $rvm_ruby_home/bin/gem
1050
1050
 
1051
1051
  home="$GEM_HOME" ; path="$GEM_PATH" # Save
1052
1052
  for dir in $rvm_ruby_global_gems_path $rvm_ruby_gem_home ; do
@@ -1086,7 +1086,7 @@ __rvm_rubygems_setup() {
1086
1086
  # Sanity check... If setup.rb is missing from the rubygems source path,
1087
1087
  # something went wrong. Cleanup, aisle 3!
1088
1088
  if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
1089
- rm -rf "$rvm_src_path/$rvm_gem_package_name"
1089
+ \rm -rf "$rvm_src_path/$rvm_gem_package_name"
1090
1090
  fi
1091
1091
 
1092
1092
  if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
@@ -1095,7 +1095,7 @@ __rvm_rubygems_setup() {
1095
1095
  result=$? ; if [[ "$result" -gt 0 ]] ; then
1096
1096
  $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
1097
1097
  fi
1098
- mkdir -p "$rvm_src_path/$rvm_gem_package_name"
1098
+ \mkdir -p "$rvm_src_path/$rvm_gem_package_name"
1099
1099
  __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 ..."
1100
1100
  fi
1101
1101
 
@@ -1120,8 +1120,8 @@ __rvm_rubygems_setup() {
1120
1120
 
1121
1121
  if [[ -n "$ruby_lib_gem_path" ]]; then
1122
1122
  # Add ruby's gem path to ruby's lib direcotry.
1123
- mkdir -p $(dirname $ruby_lib_gem_path)
1124
- if [[ -d "$ruby_lib_gem_path" ]] ; then rm -rf "$ruby_lib_gem_path" ; fi
1123
+ \mkdir -p $(dirname $ruby_lib_gem_path)
1124
+ if [[ -d "$ruby_lib_gem_path" ]] ; then \rm -rf "$ruby_lib_gem_path" ; fi
1125
1125
  ln -nfs "$rvm_ruby_gem_home" "$ruby_lib_gem_path"
1126
1126
  fi; unset ruby_lib_gem_path
1127
1127