rvm 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/binscripts/rvm-auto-ruby +6 -1
- data/binscripts/rvmsudo +22 -6
- data/config/db +1 -1
- data/config/known +1 -1
- data/config/md5 +4 -4
- data/examples/rvmrc +0 -4
- data/install +21 -23
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/alias +22 -14
- data/scripts/base +6 -0
- data/scripts/cd +4 -5
- data/scripts/cli +22 -14
- data/scripts/docs +41 -13
- data/scripts/env +1 -1
- data/scripts/environment-convertor +1 -1
- data/scripts/fetch +139 -27
- data/scripts/gemsets +71 -23
- data/scripts/hook +2 -2
- data/scripts/info +13 -2
- data/scripts/initialize +3 -22
- data/scripts/install +21 -23
- data/scripts/list +21 -21
- data/scripts/log +2 -1
- data/scripts/manage +191 -142
- data/scripts/migrate +21 -12
- data/scripts/notes +1 -1
- data/scripts/package +41 -23
- data/scripts/repair +16 -10
- data/scripts/rubygems +68 -18
- data/scripts/rvm +22 -5
- data/scripts/rvm-install +21 -23
- data/scripts/selector +43 -44
- data/scripts/snapshot +55 -19
- data/scripts/update +21 -23
- data/scripts/upgrade +18 -5
- data/scripts/utility +269 -126
- data/scripts/wrapper +21 -8
- metadata +4 -4
data/scripts/update
CHANGED
@@ -194,9 +194,6 @@ question="\n<?>"
|
|
194
194
|
cwd="$PWD"
|
195
195
|
|
196
196
|
source_path="${source_path:-$cwd}"
|
197
|
-
rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
|
198
|
-
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
|
199
|
-
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
|
200
197
|
|
201
198
|
if [[ "$rvm_selfcontained" = "0" ]] ; then
|
202
199
|
rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
|
@@ -209,9 +206,6 @@ else
|
|
209
206
|
fi
|
210
207
|
|
211
208
|
rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
|
212
|
-
rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
213
|
-
rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
|
214
|
-
rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
|
215
209
|
rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
216
210
|
|
217
211
|
printf "
|
@@ -230,7 +224,9 @@ else
|
|
230
224
|
|
231
225
|
fi
|
232
226
|
|
233
|
-
|
227
|
+
directories=( "${rvm_archives_path:-"$rvm_path/archives"}" "${rvm_src_path:-"$rvm_path/src"}" "${rvm_log_path:-"$rvm_path/log"}" "$rvm_bin_path" "${rvm_gems_path:-"$rvm_path/gems"}" "${rvm_rubies_path:-"$rvm_path/rubies"}" "$rvm_path/config" "${rvm_tmp_path:-"$rvm_path/tmp"}" )
|
228
|
+
|
229
|
+
for directory in "${directories[@]}" ; do
|
234
230
|
|
235
231
|
if [[ ! -d "$directory" ]] ; then
|
236
232
|
|
@@ -240,7 +236,9 @@ for directory in "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_
|
|
240
236
|
|
241
237
|
done
|
242
238
|
|
243
|
-
|
239
|
+
files=(README LICENCE)
|
240
|
+
|
241
|
+
for file in "${files[@]}"; do
|
244
242
|
|
245
243
|
cp -f "$source_path/$file" "$rvm_path/"
|
246
244
|
|
@@ -265,8 +263,8 @@ for dir_name in config scripts examples lib hooks help patches; do
|
|
265
263
|
|
266
264
|
done
|
267
265
|
|
268
|
-
if [[ ! -s "$
|
269
|
-
echo '# Users settings file, overrides db file settings and persists across installs.' >> "$
|
266
|
+
if [[ ! -s "$rvm_path/config/user" ]] ; then
|
267
|
+
echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_path/config/user"
|
270
268
|
fi
|
271
269
|
|
272
270
|
scripts=(monitor match log install color db fetch log set package)
|
@@ -281,15 +279,17 @@ done
|
|
281
279
|
# Bin Scripts
|
282
280
|
#
|
283
281
|
# Cleanse and purge...
|
284
|
-
|
282
|
+
files=(rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby)
|
283
|
+
|
284
|
+
for file in "${files[@]}" ; do
|
285
285
|
|
286
286
|
rm -f "$rvm_bin_path/$file"
|
287
287
|
|
288
|
-
cp -f "$source_path/binscripts/$file" $rvm_bin_path/
|
288
|
+
cp -f "$source_path/binscripts/$file" "${rvm_bin_path:-"$rvm_path/bin"}/"
|
289
289
|
|
290
290
|
done
|
291
291
|
|
292
|
-
chmod +x "$rvm_bin_path"/* # TODO: this is quite suboptimal.
|
292
|
+
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}"/* # TODO: this is quite suboptimal.
|
293
293
|
|
294
294
|
#
|
295
295
|
# RC Files
|
@@ -389,17 +389,15 @@ fi
|
|
389
389
|
#
|
390
390
|
# Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
|
391
391
|
#
|
392
|
-
|
393
|
-
|
394
|
-
mkdir -p "$rvm_rubies_path/"
|
392
|
+
mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
395
393
|
|
396
394
|
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
|
397
395
|
|
398
396
|
if [[ -d "$ruby" ]] ; then
|
399
397
|
|
400
|
-
mv "$ruby" "$rvm_rubies_path/"
|
398
|
+
mv "$ruby" "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
401
399
|
|
402
|
-
new_path="$rvm_rubies_path/$(basename $ruby)"
|
400
|
+
new_path="${rvm_rubies_path:-"$rvm_path/rubies"}/$(basename $ruby)"
|
403
401
|
|
404
402
|
for file in gem rake ; do
|
405
403
|
|
@@ -468,9 +466,9 @@ for gemset in "$rvm_path"/gems/*\@ ; do
|
|
468
466
|
done
|
469
467
|
|
470
468
|
# Move from legacy defaults to the new, alias based system.
|
471
|
-
if [[ -s "$
|
469
|
+
if [[ -s "$rvm_path/config/default" ]]; then
|
472
470
|
|
473
|
-
original_version="$(basename "$(grep GEM_HOME "$
|
471
|
+
original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
|
474
472
|
|
475
473
|
if [[ -n "$original_version" ]]; then
|
476
474
|
|
@@ -478,7 +476,7 @@ if [[ -s "$rvm_config_path/default" ]]; then
|
|
478
476
|
|
479
477
|
fi ; unset original_version
|
480
478
|
|
481
|
-
rm -rf "$
|
479
|
+
rm -rf "$rvm_path/config/default"
|
482
480
|
|
483
481
|
fi
|
484
482
|
|
@@ -487,11 +485,11 @@ fi
|
|
487
485
|
#
|
488
486
|
printf "\n Correct permissions for base binaries in $rvm_bin_path..."
|
489
487
|
|
490
|
-
mkdir -p "$rvm_bin_path"
|
488
|
+
mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
|
491
489
|
|
492
490
|
for file in rvm rvmsudo rvm-shell rvm-auto-ruby ; do
|
493
491
|
|
494
|
-
[[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
|
492
|
+
[[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] && chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
495
493
|
|
496
494
|
done
|
497
495
|
|
data/scripts/upgrade
CHANGED
@@ -4,8 +4,19 @@ unset GREP_OPTIONS
|
|
4
4
|
source "$rvm_path/scripts/base"
|
5
5
|
|
6
6
|
usage() {
|
7
|
-
|
8
|
-
|
7
|
+
printf "
|
8
|
+
|
9
|
+
Usage:
|
10
|
+
|
11
|
+
rvm upgrade prefix [ruby-string]
|
12
|
+
|
13
|
+
Description:
|
14
|
+
|
15
|
+
Upgrades the latest installed ruby with a given ruby string
|
16
|
+
(e.g. ree) to the latest known version.
|
17
|
+
|
18
|
+
" >&2
|
19
|
+
|
9
20
|
exit 1
|
10
21
|
}
|
11
22
|
|
@@ -55,14 +66,16 @@ upgrade_ruby() {
|
|
55
66
|
|
56
67
|
confirm "Are you sure you wish to upgrade from $expanded_source to $expanded_destination?" || die_with_error "Cancelling upgrade."
|
57
68
|
|
58
|
-
if [[ ! -d "$
|
69
|
+
if [[ ! -d "$rvm_path/rubies/$expanded_destination" ]]; then
|
59
70
|
|
60
71
|
"$rvm_path/scripts/log" "info" \
|
61
72
|
"Installing new ruby $expanded_destination"
|
62
73
|
|
63
|
-
$rvm_bin_path/rvm install "$expanded_destination"
|
74
|
+
"${rvm_bin_path:-"$rvm_path/bin"}/rvm" install "$expanded_destination"
|
75
|
+
|
76
|
+
result="$?"
|
64
77
|
|
65
|
-
|
78
|
+
[[ "$result" -gt 0 ]] && die_with_error "Unable to install ruby $expanded_destination. Please install it manually to continue." "$result"
|
66
79
|
|
67
80
|
fi
|
68
81
|
|
data/scripts/utility
CHANGED
@@ -15,9 +15,13 @@ __rvm_setup() {
|
|
15
15
|
|
16
16
|
__rvm_teardown() {
|
17
17
|
if [[ -n "${ZSH_VERSION:-""}" ]] ; then
|
18
|
+
|
18
19
|
if [[ "$rvm_zsh_clobber" -eq 0 ]] ; then
|
20
|
+
|
19
21
|
setopt noclobber
|
22
|
+
|
20
23
|
fi ; unset rvm_zsh_clobber
|
24
|
+
|
21
25
|
else
|
22
26
|
: # currently we are not doing any option setting for bash.
|
23
27
|
fi
|
@@ -27,14 +31,21 @@ __rvm_teardown() {
|
|
27
31
|
|
28
32
|
# Clean up after CC switch
|
29
33
|
if [[ ${rvm_clang_flag:-0} -gt 0 ]] ; then
|
34
|
+
|
30
35
|
if [[ -n "${rvm_prior_cc:-""}" ]] ; then
|
36
|
+
|
31
37
|
export CC="$rvm_prior_cc"
|
38
|
+
|
32
39
|
else
|
40
|
+
|
33
41
|
unset CC
|
42
|
+
|
34
43
|
fi
|
44
|
+
|
35
45
|
fi
|
36
46
|
|
37
|
-
unset rvm_ruby_strings rvm_head_flag rvm_prior_cc
|
47
|
+
unset rvm_ruby_strings rvm_head_flag rvm_prior_cc next_token result rvm_bin_path rvm_error_message rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_interactive_flag rvm_man_path rvm_parse_break rvm_rc_files rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_tag rvm_ruby_version rvm_selfcontained rvm_token
|
48
|
+
|
38
49
|
|
39
50
|
[[ ${rvm_dump_environment_flag:-0} -eq 1 ]] && __rvm_dump_environment
|
40
51
|
|
@@ -91,19 +102,19 @@ __rvm_ruby_string_paths_under() {
|
|
91
102
|
}
|
92
103
|
|
93
104
|
# Query the rvm key-value database for a specific key
|
94
|
-
# Allow overrides from user specifications in $
|
105
|
+
# Allow overrides from user specifications in $rvm_path/config/user
|
95
106
|
__rvm_db() {
|
96
107
|
local value key variable
|
97
108
|
|
98
109
|
key=${1:-""}
|
99
110
|
variable=${2:-""}
|
100
111
|
|
101
|
-
if [[ -f "$
|
102
|
-
value="$($rvm_path/scripts/db "$
|
112
|
+
if [[ -f "$rvm_path/config/user" ]] ; then
|
113
|
+
value="$($rvm_path/scripts/db "$rvm_path/config/user" "$key")"
|
103
114
|
fi
|
104
115
|
|
105
116
|
if [[ -z "$value" ]] ; then
|
106
|
-
value="$($rvm_path/scripts/db "$
|
117
|
+
value="$($rvm_path/scripts/db "$rvm_path/config/db" "$key")"
|
107
118
|
fi
|
108
119
|
|
109
120
|
if [[ -n "$value" ]] ; then
|
@@ -206,7 +217,7 @@ __rvm_clean_path() {
|
|
206
217
|
|
207
218
|
# Clean all rvm items out of the current working path.
|
208
219
|
__rvm_remove_rvm_from_path() {
|
209
|
-
PATH="${PATH
|
220
|
+
PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: "/${rvm_path//\//\/}/ {next} {print}")"
|
210
221
|
|
211
222
|
export PATH
|
212
223
|
|
@@ -216,38 +227,43 @@ __rvm_remove_rvm_from_path() {
|
|
216
227
|
# Run a specified command and log it.
|
217
228
|
__rvm_run() {
|
218
229
|
|
219
|
-
local log_file_name command message
|
230
|
+
local result log_file_name command message
|
220
231
|
|
221
232
|
log_file_name="${1:-""}"
|
222
233
|
command="${2:-""}"
|
223
234
|
message="${3:-""}"
|
224
235
|
|
225
|
-
if [[ -z "${rvm_ruby_log_path:-""}" ]] ; then rvm_ruby_log_path="$rvm_log_path" ; fi
|
226
|
-
|
227
236
|
if [[ -n "$message" ]] ; then "$rvm_path/scripts/log" "info" "$message" ; fi
|
228
237
|
|
229
238
|
if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
|
230
239
|
"$rvm_path/scripts/log" "debug" "Executing: $command"
|
231
240
|
fi
|
232
241
|
|
233
|
-
\mkdir -p "$(dirname "$
|
242
|
+
\mkdir -p "$(dirname "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log")"
|
234
243
|
|
235
|
-
\touch "$
|
244
|
+
\touch "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" \
|
245
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log" # for zsh :(
|
236
246
|
|
237
|
-
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | \
|
247
|
+
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | \
|
248
|
+
\tee "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" >> \
|
249
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log"
|
238
250
|
|
239
251
|
(
|
240
252
|
if [[ -z "${rvm_niceness:-""}" || "0" = "${rvm_niceness:-""}" ]] ; then
|
241
|
-
eval "$command" >>
|
253
|
+
eval "$command" >> \
|
254
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" 2>> \
|
255
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log"
|
242
256
|
else
|
243
|
-
eval "nice -n $rvm_niceness $command" >>
|
257
|
+
eval "nice -n $rvm_niceness $command" >> \
|
258
|
+
${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log 2>> \
|
259
|
+
${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log
|
244
260
|
fi
|
245
261
|
)
|
246
262
|
local result=$?
|
247
263
|
|
248
264
|
if [[ $result -gt 0 ]] ; then
|
249
265
|
"$rvm_path/scripts/log" "error" \
|
250
|
-
"Error running '$command', please check $
|
266
|
+
"Error running '$command', please check ${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name*.log"
|
251
267
|
fi
|
252
268
|
|
253
269
|
return $result
|
@@ -256,7 +272,7 @@ __rvm_run() {
|
|
256
272
|
# Runs a command in a given env.
|
257
273
|
__rvm_run_with_env() {
|
258
274
|
|
259
|
-
local log_file_name env_name comand message
|
275
|
+
local result log_file_name env_name comand message
|
260
276
|
|
261
277
|
log_file_name="${1:-""}"
|
262
278
|
env_name="${2:-""}"
|
@@ -265,32 +281,38 @@ __rvm_run_with_env() {
|
|
265
281
|
|
266
282
|
if [[ -z "$env_name" ]]; then env_name="$(__rvm_environment_identifier)"; fi
|
267
283
|
|
268
|
-
if [[ -z "$rvm_ruby_log_path" ]] ; then rvm_ruby_log_path="$rvm_log_path" ; fi
|
269
|
-
|
270
284
|
if [[ -n "$message" ]] ; then "$rvm_path/scripts/log" "info" "$message" ; fi
|
271
285
|
|
272
286
|
if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
|
273
287
|
"$rvm_path/scripts/log" "debug" "Executing: $command in environment "$env_name""
|
274
288
|
fi
|
275
289
|
|
276
|
-
\mkdir -p "$(dirname "$
|
290
|
+
\mkdir -p "$(dirname "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log")"
|
277
291
|
|
278
|
-
\touch
|
292
|
+
\touch \
|
293
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" \
|
294
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log" # for zsh :(
|
279
295
|
|
280
|
-
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command # under $env_name" |
|
296
|
+
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command # under $env_name" | \
|
297
|
+
tee "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" >> \
|
298
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log"
|
281
299
|
|
282
300
|
(
|
283
301
|
if [[ -z "${rvm_niceness:-""}" || $rvm_niceness -eq 0 ]] ; then
|
284
|
-
eval "__rvm_with_env '$env_name' '$command'" >>
|
302
|
+
eval "__rvm_with_env '$env_name' '$command'" >> \
|
303
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log" 2>> \
|
304
|
+
"${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log"
|
285
305
|
else
|
286
|
-
eval "nice -n $rvm_niceness __rvm_with_env '$env_name' '$command'" >>
|
306
|
+
eval "nice -n $rvm_niceness __rvm_with_env '$env_name' '$command'" >> \
|
307
|
+
${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.log 2>> \
|
308
|
+
${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name.error.log
|
287
309
|
fi
|
288
310
|
)
|
289
311
|
result=$?
|
290
312
|
|
291
313
|
if [[ $result -gt 0 ]] ; then
|
292
314
|
"$rvm_path/scripts/log" "error" \
|
293
|
-
"Error running '$command' under $env_name, please check $
|
315
|
+
"Error running '$command' under $env_name, please check ${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/$log_file_name*.log"
|
294
316
|
fi
|
295
317
|
|
296
318
|
return $result
|
@@ -325,8 +347,9 @@ __rvm_with_env() {
|
|
325
347
|
command="$2"
|
326
348
|
|
327
349
|
(
|
328
|
-
|
329
|
-
|
350
|
+
rvm use "$environment_id"
|
351
|
+
|
352
|
+
eval "$command"
|
330
353
|
)
|
331
354
|
}
|
332
355
|
|
@@ -335,11 +358,11 @@ __rvm_with_env() {
|
|
335
358
|
__rvm_18_compat_ruby() {
|
336
359
|
local rubies ruby_name
|
337
360
|
|
338
|
-
rubies=($( cd "$
|
361
|
+
rubies=($( cd "$rvm_path/rubies" ; find . -maxdepth 1 -mindepth 1 -type d ))
|
339
362
|
|
340
363
|
for ruby_name in "${rubies[@]//.\/}"; do
|
341
364
|
|
342
|
-
if [[ ! -L "$
|
365
|
+
if [[ ! -L "$rvm_path/rubies/$ruby_name" ]] ; then
|
343
366
|
|
344
367
|
case $ruby_name in
|
345
368
|
*1.8.*|rbx-*|ree-*) rubies="$rubies $ruby_name" ;;
|
@@ -375,57 +398,70 @@ __rvm_ensure_has_18_compat_ruby() {
|
|
375
398
|
return 0
|
376
399
|
}
|
377
400
|
|
378
|
-
# Cleans up temp folders for a given prefix,
|
401
|
+
# Cleans up temp folders for a given prefix ($1),
|
379
402
|
# typically the current process id.
|
380
403
|
__rvm_cleanup_temp_for() {
|
381
404
|
result=$? # Capture last command status
|
382
405
|
|
383
|
-
|
384
|
-
|
385
|
-
prefix="$1"
|
386
|
-
|
387
|
-
[[ -z "$prefix" ]] && return 1
|
406
|
+
[[ -z "${1:-""}" ]] && return 1
|
388
407
|
|
389
|
-
if [[ -d "$rvm_tmp_path/" ]]; then
|
390
|
-
\rm -rf "$rvm_tmp_path/$
|
408
|
+
if [[ -d "${rvm_tmp_path:-"$rvm_path/tmp"}/" ]]; then
|
409
|
+
\rm -rf "${rvm_tmp_path:-"$rvm_path/tmp"}/$1"* >/dev/null 2>&1
|
391
410
|
fi
|
392
411
|
|
393
412
|
return $result
|
394
413
|
}
|
395
414
|
|
396
415
|
__rvm_set_rvmrc() {
|
416
|
+
local flags
|
417
|
+
|
397
418
|
if [[ "$HOME" != "$PWD" ]] ; then
|
398
419
|
|
399
|
-
if [[ ${rvm_verbose_flag:-0} -gt 0 ]] ; then
|
420
|
+
if [[ ${rvm_verbose_flag:-0} -gt 0 ]] ; then
|
421
|
+
flags="use "
|
422
|
+
fi
|
400
423
|
|
401
424
|
if [[ -s .rvmrc ]] ; then
|
425
|
+
|
402
426
|
mv .rvmrc .rvmrc.$(date +%m.%d.%Y-%H:%M:%S)
|
403
|
-
|
427
|
+
|
428
|
+
"$rvm_path/scripts/log" "warning" \
|
429
|
+
".rvmrc is not empty, moving aside to preserve."
|
430
|
+
|
404
431
|
fi
|
405
432
|
|
406
433
|
local identifier=$(__rvm_environment_identifier)
|
407
434
|
|
408
|
-
printf "if [[ -n \"\$
|
409
|
-
printf "\nelse\n rvm --create $flags \"$identifier\"\nfi" >> .rvmrc
|
435
|
+
printf "if [[ -n \"\$rvm_path/environments\" && -s \"\$rvm_path/environments/$identifier\" ]] ; then\n \\. \"\$rvm_path/environments/$identifier\"\nelse\n rvm --create $flags \"$identifier\"\nfi" >> .rvmrc
|
410
436
|
|
411
|
-
unset flags
|
412
437
|
else
|
413
|
-
"$rvm_path/scripts/log" "error"
|
438
|
+
"$rvm_path/scripts/log" "error" \
|
439
|
+
".rvmrc cannot be set in your home directory. \n The home .rvmrc is for global rvm settings only."
|
414
440
|
fi
|
415
441
|
}
|
416
442
|
__rvm_load_rvmrc() {
|
417
|
-
|
418
|
-
[[ $rvm_ignore_rvmrc -eq 1 ]] && return 0
|
443
|
+
|
444
|
+
[[ ${rvm_ignore_rvmrc:-0} -eq 1 ]] && return 0
|
419
445
|
|
420
446
|
for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
|
447
|
+
|
421
448
|
if [[ -f "$rvmrc" ]] ; then
|
449
|
+
|
422
450
|
if \grep -q '^\s*rvm .*$' $rvmrc ; then
|
423
|
-
|
451
|
+
|
452
|
+
"$rvm_path/scripts/log" "error" \
|
453
|
+
"$rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
|
454
|
+
|
424
455
|
return 1
|
456
|
+
|
425
457
|
else
|
458
|
+
|
426
459
|
source "$rvmrc"
|
460
|
+
|
427
461
|
fi
|
462
|
+
|
428
463
|
fi
|
464
|
+
|
429
465
|
done
|
430
466
|
|
431
467
|
return 0
|
@@ -433,22 +469,43 @@ __rvm_load_rvmrc() {
|
|
433
469
|
|
434
470
|
# Wrap the specified ruby code file in a Benchmark.bmbm block and execute it.
|
435
471
|
__rvm_benchmark() {
|
472
|
+
|
473
|
+
local result old_rvm_ruby_string
|
474
|
+
|
436
475
|
code="require \"benchmark\" \n Benchmark.bmbm do |benchmark| \n benchmark.report(\"${rvm_ruby_file}\") do \n"
|
437
|
-
|
476
|
+
|
477
|
+
printf "\n$code" > "${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb"
|
478
|
+
|
438
479
|
unset code
|
439
|
-
|
440
|
-
|
441
|
-
|
480
|
+
|
481
|
+
cat $rvm_ruby_file >> "${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb"
|
482
|
+
|
483
|
+
printf "\n end \nend\n" >> "${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb"
|
484
|
+
|
485
|
+
rvm_ruby_args="${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb"
|
486
|
+
|
442
487
|
rvm_benchmark_flag=1
|
488
|
+
|
443
489
|
rvm_action="ruby"
|
444
|
-
|
490
|
+
|
491
|
+
if [[ ${rvm_debug_flag:0} -gt 0 ]] ; then
|
492
|
+
|
493
|
+
printf "\n${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb:\n$(cat ${rvm_tmp_path:-"$rvm_path/tmp"}/$$.rb)"
|
494
|
+
|
495
|
+
fi
|
496
|
+
|
445
497
|
# Override ruby string stuff, pass through.
|
446
|
-
|
498
|
+
|
499
|
+
old_rvm_ruby_string=$rvm_ruby_string
|
500
|
+
|
447
501
|
# TODO: We can likely do this in a subshell in order to preserve the original environment?
|
502
|
+
|
448
503
|
unset rvm_ruby_string
|
504
|
+
|
449
505
|
export rvm_ruby_strings
|
450
|
-
|
451
|
-
result=$?
|
506
|
+
|
507
|
+
"$rvm_path/scripts/set" "$rvm_action" $rvm_ruby_args ; result=$?
|
508
|
+
|
452
509
|
# Restore the state pre-sets.
|
453
510
|
[[ -n "$old_rvm_ruby_string" ]] && rvm_ruby_string=$old_rvm_ruby_string
|
454
511
|
|
@@ -457,86 +514,148 @@ __rvm_benchmark() {
|
|
457
514
|
|
458
515
|
# Loop over the currently installed rubies and refresh their binscripts.
|
459
516
|
__rvm_bin_scripts() {
|
460
|
-
|
517
|
+
|
518
|
+
for rvm_ruby_binary in "$rvm_path/rubies"/*/bin/ruby ; do
|
519
|
+
|
461
520
|
if [[ -x "$rvm_ruby_binary" ]] ; then
|
521
|
+
|
462
522
|
rvm_ruby_string=$(dirname "$rvm_ruby_binary" | xargs dirname | xargs basename)
|
523
|
+
|
463
524
|
__rvm_select
|
525
|
+
|
464
526
|
__rvm_bin_script
|
527
|
+
|
465
528
|
fi
|
529
|
+
|
466
530
|
done
|
531
|
+
|
467
532
|
return 0
|
468
533
|
}
|
469
534
|
|
470
535
|
# Write the bin/ wrapper script for currently selected ruby.
|
471
536
|
# TODO: Adjust binscript to be able to handle all rubies not just the standard interpreteres.
|
472
537
|
__rvm_bin_script() {
|
538
|
+
|
473
539
|
"$rvm_path/scripts/wrapper" "$rvm_ruby_string"
|
540
|
+
|
474
541
|
return $?
|
475
542
|
}
|
476
543
|
|
477
544
|
# Add bin path if not present
|
478
545
|
__rvm_conditionally_add_bin_path() {
|
479
|
-
|
480
|
-
|
546
|
+
|
547
|
+
if echo "${PATH//:/ }" | \grep -vqF "${rvm_bin_path:-"$rvm_path/bin"} " ; then
|
548
|
+
|
549
|
+
PATH="${rvm_bin_path:-"$rvm_path/bin"}:$PATH"
|
550
|
+
|
481
551
|
builtin hash -r
|
552
|
+
|
482
553
|
fi
|
554
|
+
|
483
555
|
return 0
|
484
556
|
}
|
485
557
|
|
486
558
|
# Reset any rvm gathered information about the system and its state.
|
487
559
|
# rvm will refresh the stored information the next time it is called after reset.
|
488
560
|
__rvm_reset() {
|
489
|
-
|
561
|
+
|
562
|
+
local flag flags file files config configs variable
|
563
|
+
|
564
|
+
__rvm_remove_rvm_from_path ; __rvm_conditionally_add_bin_path
|
565
|
+
|
566
|
+
export PATH
|
490
567
|
|
491
568
|
builtin hash -r
|
492
569
|
|
493
|
-
|
494
|
-
|
495
|
-
|
570
|
+
flags=( default passenger editor )
|
571
|
+
|
572
|
+
for flag in "${flags[@]}"; do
|
573
|
+
|
574
|
+
\rm -f "${rvm_bin_path:-"$rvm_path/bin"}"/${flag}_*
|
575
|
+
|
496
576
|
done
|
497
577
|
|
498
578
|
for file in system default ; do
|
499
|
-
|
500
|
-
[[ -f "$
|
501
|
-
|
502
|
-
|
579
|
+
|
580
|
+
[[ -f "$rvm_path/${file}" ]] && \rm -f "$rvm_path/${file}"
|
581
|
+
|
582
|
+
[[ -f "$rvm_path/config/${file}" ]] && \rm -f "$rvm_path/config/${file}"
|
583
|
+
|
584
|
+
[[ -f "$rvm_path/environments/${file}" ]] && \rm -f "$rvm_path/environments/${file}"
|
585
|
+
|
586
|
+
done
|
503
587
|
|
504
588
|
# Go back to a clean state.
|
505
589
|
__rvm_become "system"
|
590
|
+
|
506
591
|
__rvm_unset_ruby_variables
|
507
592
|
|
508
|
-
|
509
|
-
|
510
|
-
|
593
|
+
configs=(system_ruby system_gem_path system_user_gem_path)
|
594
|
+
|
595
|
+
for system_config in "${configs[@]}" ; do
|
596
|
+
|
597
|
+
"$rvm_path/scripts/db" "$rvm_path/config/user" "$system_config" "delete"
|
598
|
+
|
599
|
+
done
|
600
|
+
|
601
|
+
files=(ruby gem rake irb $(cd "${rvm_bin_path:-"$rvm_path/bin"}" ; find . -iname 'default*' --mindepth 1 --maxdepth 1 -type f | sed -e 's#./##g'))
|
602
|
+
|
603
|
+
for file in "${files[@]}"; do
|
511
604
|
|
512
|
-
|
605
|
+
if [[ -f "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
|
606
|
+
|
607
|
+
\rm -f "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
608
|
+
|
609
|
+
fi
|
610
|
+
|
611
|
+
done
|
513
612
|
|
514
613
|
return 0
|
515
614
|
}
|
516
615
|
|
517
616
|
# Implode removes the entire rvm installation under $rvm_path.
|
518
617
|
__rvm_implode() {
|
618
|
+
|
519
619
|
while : ; do
|
520
|
-
|
620
|
+
|
621
|
+
"$rvm_path/scripts/log" "warn" \
|
622
|
+
"Are you SURE you wish for rvm to implode? This will remove $rvm_path ? (type 'yes' or 'no')"
|
521
623
|
|
522
624
|
read response
|
523
625
|
|
524
626
|
if [[ "yes" = "$response" ]] ; then
|
627
|
+
|
525
628
|
if [[ "/" = "$rvm_path" ]] ; then
|
526
|
-
|
629
|
+
|
630
|
+
"$rvm_path/scripts/log" "error" \
|
631
|
+
"remove '/' ?!... Ni!"
|
632
|
+
|
527
633
|
else
|
634
|
+
|
528
635
|
if [[ -d "$rvm_path" ]] ; then
|
529
|
-
|
636
|
+
|
637
|
+
"$rvm_path/scripts/log" "info" \
|
638
|
+
"Hai! Removing $rvm_path"
|
639
|
+
|
530
640
|
\rm -rf "$rvm_path/"
|
641
|
+
|
531
642
|
echo "$rvm_path has been removed."
|
643
|
+
|
532
644
|
else
|
533
|
-
|
645
|
+
|
646
|
+
"$rvm_path/scripts/log" "info" \
|
647
|
+
"It appears that $rvm_path is already non existant."
|
648
|
+
|
534
649
|
fi
|
535
650
|
fi
|
536
651
|
break
|
652
|
+
|
537
653
|
elif [[ "no" = "$response" ]] ; then
|
538
|
-
|
654
|
+
|
655
|
+
"$rvm_path/scripts/log" "info" \
|
656
|
+
"Cancelling implosion, no harm done :)"
|
539
657
|
break
|
658
|
+
|
540
659
|
fi
|
541
660
|
done
|
542
661
|
|
@@ -545,12 +664,18 @@ __rvm_implode() {
|
|
545
664
|
|
546
665
|
# Output the current ruby's rvm source path.
|
547
666
|
__rvm_source_dir() {
|
667
|
+
|
548
668
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
549
669
|
|
550
670
|
if [[ -z "$rvm_ruby_src_path" ]] ; then
|
551
|
-
|
671
|
+
|
672
|
+
"$rvm_path/scripts/log" "fail" \
|
673
|
+
"No source directory exists for the default implementation."
|
674
|
+
|
552
675
|
else
|
676
|
+
|
553
677
|
echo "$rvm_ruby_src_path"
|
678
|
+
|
554
679
|
fi
|
555
680
|
|
556
681
|
return 0
|
@@ -563,7 +688,9 @@ __rvm_initialize() {
|
|
563
688
|
|
564
689
|
__rvm_clean_path ; __rvm_conditionally_add_bin_path ; export PATH
|
565
690
|
|
566
|
-
|
691
|
+
if [[ ! -d "${rvm_tmp_path:-"$rvm_path/tmp"}" ]] ; then
|
692
|
+
\mkdir -p "${rvm_tmp_path:-"$rvm_path/tmp"}"
|
693
|
+
fi
|
567
694
|
|
568
695
|
return 0
|
569
696
|
}
|
@@ -591,25 +718,42 @@ __rvm_update() {
|
|
591
718
|
# Update rvm using rubygems
|
592
719
|
# If --head was specified, update from git repository master branch.
|
593
720
|
__rvm_update_rvm() {
|
594
|
-
\mkdir -p "$rvm_src_path"
|
595
721
|
(
|
596
|
-
|
722
|
+
if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}" ]] ; then
|
723
|
+
\mkdir -p "${rvm_src_path:-"$rvm_path/src"}"
|
724
|
+
fi
|
725
|
+
|
726
|
+
builtin cd "${rvm_src_path:-"$rvm_path/src"}"
|
727
|
+
|
597
728
|
if [[ ${rvm_head_flag:-0} -eq 1 ]] ; then
|
598
729
|
|
599
|
-
if [[ -d "$rvm_src_path/rvm/.git" ]] ; then
|
600
|
-
|
730
|
+
if [[ -d "${rvm_src_path:-"$rvm_path/src"}/rvm/.git" ]] ; then
|
731
|
+
|
732
|
+
builtin cd "${rvm_src_path:-"$rvm_path/src"}/rvm/" && \
|
733
|
+
git pull origin master && \
|
734
|
+
./scripts/install
|
601
735
|
|
602
736
|
else
|
603
|
-
|
737
|
+
|
738
|
+
builtin cd "${rvm_src_path:-"$rvm_path/src"}" && \
|
739
|
+
( git clone --depth 1 git://github.com/wayneeseguin/rvm.git || \
|
740
|
+
git clone http://github.com/wayneeseguin/rvm.git ) && \
|
741
|
+
builtin cd rvm/ && ./scripts/install
|
604
742
|
fi
|
605
743
|
else
|
606
744
|
stable_version="$(curl -s http://rvm.beginrescueend.com/releases/stable-version.txt)"
|
607
745
|
|
608
|
-
__rvm_run "fetch"
|
746
|
+
__rvm_run "fetch" \
|
747
|
+
"$rvm_path/scripts/fetch 'http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz'" \
|
748
|
+
"fetching rvm-${stable_version}.tar.gz"
|
609
749
|
|
610
|
-
__rvm_run "extract"
|
750
|
+
__rvm_run "extract" \
|
751
|
+
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/rvm-${stable_version}.tar.gz\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}" \
|
752
|
+
"Extracting rvm-${stable_version}.tar.gz ..."
|
611
753
|
|
612
|
-
__rvm_run "install"
|
754
|
+
__rvm_run "install" \
|
755
|
+
"builtin cd ${rvm_src_path:-"$rvm_path/src"}/rvm-${stable_version}/ ; ./install" \
|
756
|
+
"Installing rvm-${stable_version}..."
|
613
757
|
fi
|
614
758
|
)
|
615
759
|
|
@@ -681,24 +825,18 @@ __rvm_state() {
|
|
681
825
|
|
682
826
|
# Output an inspection of selected 'binary' scripts, based on CLI selection.
|
683
827
|
__rvm_inspect() {
|
684
|
-
rvm_shebang_flag=${rvm_shebang_flag:-0}
|
685
|
-
rvm_env_flag=${rvm_env_flag:-0}
|
686
|
-
rvm_path_flag=${rvm_path_flag:-0}
|
687
|
-
rvm_head_flag=${rvm_head_flag:-0}
|
688
|
-
rvm_tail_flag=${rvm_tail_flag:-0}
|
689
|
-
rvm_all_flag=${rvm_all_flag:-0}
|
690
828
|
|
691
829
|
for binary in $rvm_ruby_args ; do
|
692
|
-
actual_file="$(command -v
|
830
|
+
actual_file="$(unset -f gem ; command -v gem )"
|
693
831
|
|
694
832
|
"$rvm_path/scripts/log" "info" "$actual_file:"
|
695
833
|
|
696
|
-
if [[ $rvm_shebang_flag -eq 1 ]] ; then \head -n 1 < "$actual_file" ; fi
|
697
|
-
if [[ $rvm_env_flag -eq 1 ]] ; then \awk '/ENV/' < "$actual_file" ; fi
|
698
|
-
if [[ $rvm_path_flag -eq 1 ]] ; then \awk '/PATH/' < "$actual_file" ; fi
|
699
|
-
if [[ $rvm_head_flag -eq 1 ]] ; then \head -n 5 < "$actual_file" ; fi
|
700
|
-
if [[ $rvm_tail_flag -eq 1 ]] ; then \tail -n 5 < "$actual_file" ; fi
|
701
|
-
if [[ $rvm_all_flag -eq 1 ]] ; then \cat $actual_file ; fi
|
834
|
+
if [[ ${rvm_shebang_flag:-0} -eq 1 ]] ; then \head -n 1 < "$actual_file" ; fi
|
835
|
+
if [[ ${rvm_env_flag:-0} -eq 1 ]] ; then \awk '/ENV/' < "$actual_file" ; fi
|
836
|
+
if [[ ${rvm_path_flag:-0} -eq 1 ]] ; then \awk '/PATH/' < "$actual_file" ; fi
|
837
|
+
if [[ ${rvm_head_flag:-0} -eq 1 ]] ; then \head -n 5 < "$actual_file" ; fi
|
838
|
+
if [[ ${rvm_tail_flag:-0} -eq 1 ]] ; then \tail -n 5 < "$actual_file" ; fi
|
839
|
+
if [[ ${rvm_all_flag:-0} -eq 1 ]] ; then \cat $actual_file ; fi
|
702
840
|
done
|
703
841
|
|
704
842
|
return 0
|
@@ -742,12 +880,12 @@ __rvm_make_flags() {
|
|
742
880
|
}
|
743
881
|
|
744
882
|
__rvm_mono_env() {
|
745
|
-
export DYLD_LIBRARY_PATH="$rvm_usr_path/lib:$DYLD_LIBRARY_PATH"
|
746
|
-
export C_INCLUDE_PATH="$rvm_usr_path/include:$C_INCLUDE_PATH"
|
747
|
-
export ACLOCAL_PATH="$rvm_usr_path/share/aclocal"
|
883
|
+
export DYLD_LIBRARY_PATH="${rvm_usr_path:-"$rvm_path/usr"}/lib:$DYLD_LIBRARY_PATH"
|
884
|
+
export C_INCLUDE_PATH="${rvm_usr_path:-"$rvm_path/usr"}/include:$C_INCLUDE_PATH"
|
885
|
+
export ACLOCAL_PATH="${rvm_usr_path:-"$rvm_path/usr"}/share/aclocal"
|
748
886
|
export ACLOCAL_FLAGS="-I $ACLOCAL_PATH"
|
749
|
-
export PKG_CONFIG_PATH="$rvm_usr_path/lib/pkgconfig:$PKG_CONFIG_PATH"
|
750
|
-
PATH="$rvm_usr_path/bin:$PATH"
|
887
|
+
export PKG_CONFIG_PATH="${rvm_usr_path:-"$rvm_path/usr"}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
888
|
+
PATH="${rvm_usr_path:-"$rvm_path/usr"}/bin:$PATH"
|
751
889
|
builtin hash -r
|
752
890
|
|
753
891
|
return 0
|
@@ -764,13 +902,17 @@ __rvm_become() {
|
|
764
902
|
}
|
765
903
|
|
766
904
|
__rvm_ensure_has_environment_files() {
|
767
|
-
local environment_identifier
|
768
|
-
|
905
|
+
local environment_identifier file_name directory_name wrapper_identifier variable value
|
906
|
+
|
907
|
+
environment_identifier="$(__rvm_environment_identifier)"
|
908
|
+
|
909
|
+
file_name="${rvm_path}/environments/$environment_identifier"
|
769
910
|
|
770
911
|
if [[ ! -s "$file_name" ]] ; then
|
771
|
-
\mkdir -p "${rvm_environments_path}"
|
772
912
|
|
773
|
-
|
913
|
+
\mkdir -p "$rvm_path/environments"
|
914
|
+
|
915
|
+
echo "export PATH=\"${rvm_ruby_gem_home}/bin:${rvm_ruby_global_gems_path}/bin:${rvm_ruby_home}/bin:${rvm_bin_path:-"$rvm_path/bin"}:\$PATH\"" > "$file_name"
|
774
916
|
|
775
917
|
for variable in RUBY_VERSION GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gemset_name MAGLEV_HOME ; do
|
776
918
|
|
@@ -782,19 +924,19 @@ __rvm_ensure_has_environment_files() {
|
|
782
924
|
else
|
783
925
|
printf "unset ${variable}\n" >> "$file_name"
|
784
926
|
fi
|
785
|
-
done ; unset variable value
|
786
|
-
fi ; unset file_name
|
787
927
|
|
788
|
-
|
789
|
-
|
928
|
+
done
|
929
|
+
fi
|
930
|
+
|
790
931
|
# Next, ensure we have default wrapper files. Also, prevent it from recursing.
|
791
932
|
if [[ ${rvm_creating_default_wrappers:-0} -eq 1 ]]; then
|
933
|
+
|
792
934
|
# We need to generate wrappers for both the default gemset and the global gemset.
|
793
935
|
for wrapper_identifier in "$environment_identifier" "${environment_identifier}@global" ; do
|
794
936
|
|
795
937
|
rvm_creating_default_wrappers=1
|
796
938
|
|
797
|
-
directory_name="$
|
939
|
+
directory_name="$rvm_path/wrappers/$wrapper_identifier"
|
798
940
|
|
799
941
|
if [[ ! -L "$directory_name" && ! -d "$directory_name" ]]; then
|
800
942
|
\mkdir -p "$directory_name"
|
@@ -804,6 +946,7 @@ __rvm_ensure_has_environment_files() {
|
|
804
946
|
rvm_creating_default_wrappers=0
|
805
947
|
done
|
806
948
|
fi
|
949
|
+
|
807
950
|
return 0
|
808
951
|
}
|
809
952
|
|
@@ -814,7 +957,7 @@ __rvm_strip() {
|
|
814
957
|
}
|
815
958
|
|
816
959
|
__rvm_using_gemset_globalcache() {
|
817
|
-
"$rvm_path/scripts/db" "$
|
960
|
+
"$rvm_path/scripts/db" "$rvm_path/config/user" "use_gemset_globalcache" | \grep -q '^true$'
|
818
961
|
return $?
|
819
962
|
}
|
820
963
|
|
@@ -844,12 +987,12 @@ __rvm_ultimate_question() {
|
|
844
987
|
|
845
988
|
__rvm_load_env_file() {
|
846
989
|
local string="$1"
|
847
|
-
if [[ -f "$
|
990
|
+
if [[ -f "$rvm_path/environments/$string" ]]; then
|
848
991
|
# Restore the path to it's state minus rvm
|
849
992
|
__rvm_remove_rvm_from_path
|
850
993
|
|
851
994
|
# source the environment file
|
852
|
-
\. "$
|
995
|
+
\. "$rvm_path/environments/$string"
|
853
996
|
|
854
997
|
# clear the PATH cache
|
855
998
|
builtin hash -r
|
@@ -880,28 +1023,28 @@ __rvm_rvmrc_key() {
|
|
880
1023
|
}
|
881
1024
|
|
882
1025
|
__rvm_reset_rvmrc_trust() {
|
883
|
-
touch "$
|
884
|
-
"$rvm_path/scripts/db" "$
|
1026
|
+
touch "$rvm_path/config/rvmrcs"
|
1027
|
+
"$rvm_path/scripts/db" "$rvm_path/config/rvmrcs" "$(__rvm_rvmrc_key "$1")" "delete" >/dev/null 2>&1
|
885
1028
|
return $?
|
886
1029
|
}
|
887
1030
|
|
888
1031
|
__rvm_trust_rvmrc() {
|
889
|
-
touch "$
|
1032
|
+
touch "$rvm_path/config/rvmrcs"
|
890
1033
|
__rvm_reset_rvmrc_trust "$1"
|
891
|
-
"$rvm_path/scripts/db" "$
|
1034
|
+
"$rvm_path/scripts/db" "$rvm_path/config/rvmrcs" "$(__rvm_rvmrc_key "$1")" "1" >/dev/null 2>&1
|
892
1035
|
return $?
|
893
1036
|
}
|
894
1037
|
|
895
1038
|
__rvm_untrust_rvmrc() {
|
896
|
-
touch "$
|
1039
|
+
touch "$rvm_path/config/rvmrcs"
|
897
1040
|
__rvm_reset_rvmrc_trust "$1"
|
898
|
-
"$rvm_path/scripts/db" "$
|
1041
|
+
"$rvm_path/scripts/db" "$rvm_path/config/rvmrcs" "$(__rvm_rvmrc_key "$1")" "0" >/dev/null 2>&1
|
899
1042
|
return $?
|
900
1043
|
}
|
901
1044
|
|
902
1045
|
__rvm_rvmrc_stored_trust() {
|
903
|
-
touch "$
|
904
|
-
"$rvm_path/scripts/db" "$
|
1046
|
+
touch "$rvm_path/config/rvmrcs"
|
1047
|
+
"$rvm_path/scripts/db" "$rvm_path/config/rvmrcs" "$(__rvm_rvmrc_key "$1")"
|
905
1048
|
return $?
|
906
1049
|
}
|
907
1050
|
|
@@ -1076,7 +1219,7 @@ __rvm_record_install() {
|
|
1076
1219
|
|
1077
1220
|
recorded_ruby_name="$($rvm_path/scripts/tools strings "$1")"
|
1078
1221
|
|
1079
|
-
rvm_install_record_file="$
|
1222
|
+
rvm_install_record_file="$rvm_path/config/installs"
|
1080
1223
|
|
1081
1224
|
rvm_install_command="$(echo "$recorded_ruby_name $rvm_install_arguments" | __rvm_strip)"
|
1082
1225
|
|
@@ -1100,7 +1243,7 @@ __rvm_remove_install_record() {
|
|
1100
1243
|
|
1101
1244
|
recorded_ruby_name="$($rvm_path/scripts/tools strings "$1")"
|
1102
1245
|
|
1103
|
-
rvm_install_record_file="$
|
1246
|
+
rvm_install_record_file="$rvm_path/config/installs"
|
1104
1247
|
|
1105
1248
|
if [[ -s "$rvm_install_record_file" ]]; then
|
1106
1249
|
|
@@ -1124,9 +1267,9 @@ __rvm_recorded_install_command() {
|
|
1124
1267
|
|
1125
1268
|
recorded_ruby_match="^$recorded_ruby_name "
|
1126
1269
|
|
1127
|
-
if [[ -s "$
|
1270
|
+
if [[ -s "$rvm_path/config/installs" ]] && \grep -q "$recorded_ruby_match" "$rvm_path/config/installs" ; then
|
1128
1271
|
|
1129
|
-
\grep "$recorded_ruby_match" < "$
|
1272
|
+
\grep "$recorded_ruby_match" < "$rvm_path/config/installs" | head -n1
|
1130
1273
|
|
1131
1274
|
else
|
1132
1275
|
return 1
|
@@ -1172,7 +1315,7 @@ __rvm_expand_ruby_string() {
|
|
1172
1315
|
__rvm_environment_identifier
|
1173
1316
|
|
1174
1317
|
elif [[ "$string" = "aliases" ]]; then
|
1175
|
-
awk -F= '{print $string}' < "$
|
1318
|
+
awk -F= '{print $string}' < "$rvm_path/config/alias"
|
1176
1319
|
|
1177
1320
|
else
|
1178
1321
|
|