rvm 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/binscripts/rvm-prompt +15 -16
- data/contrib/gemset_snapshot +1 -1
- data/install +19 -20
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -3
- data/scripts/alias +28 -20
- data/scripts/base +1 -1
- data/scripts/cleanup +1 -1
- data/scripts/cli +83 -104
- data/scripts/completion +28 -1
- data/scripts/docs +11 -11
- data/scripts/fetch +15 -15
- data/scripts/gemsets +72 -75
- data/scripts/help +9 -10
- data/scripts/hook +3 -1
- data/scripts/info +8 -6
- data/scripts/install +19 -20
- data/scripts/list +31 -40
- data/scripts/maglev +18 -18
- data/scripts/manage +190 -193
- data/scripts/match +1 -0
- data/scripts/migrate +10 -11
- data/scripts/monitor +4 -4
- data/scripts/package +14 -14
- data/scripts/patches +3 -4
- data/scripts/repair +5 -5
- data/scripts/rubygems +11 -11
- data/scripts/rvm +3 -3
- data/scripts/rvm-install +19 -20
- data/scripts/selector +68 -64
- data/scripts/set +10 -10
- data/scripts/snapshot +29 -28
- data/scripts/tools +7 -9
- data/scripts/update +19 -20
- data/scripts/upgrade +7 -7
- data/scripts/utility +96 -93
- data/scripts/wrapper +13 -18
- metadata +4 -5
- data/scripts/manpages +0 -8
data/scripts/manage
CHANGED
@@ -8,7 +8,7 @@ source "$rvm_scripts_path/patches"
|
|
8
8
|
|
9
9
|
__rvm_check_for_clang() {
|
10
10
|
if [[ -n "$rvm_clang_flag" ]] && ! command -v clang >/dev/null ; then
|
11
|
-
$rvm_scripts_path/log "fail" "You passed the --clang option and clang isn't in your path. Please try again / don't use --clang"
|
11
|
+
"$rvm_scripts_path/log" "fail" "You passed the --clang option and clang isn't in your path. Please try again / don't use --clang"
|
12
12
|
return 1
|
13
13
|
fi
|
14
14
|
}
|
@@ -17,7 +17,7 @@ __rvm_check_for_clang() {
|
|
17
17
|
__rvm_check_for_bison() {
|
18
18
|
if [[ "$rvm_head_flag" -gt 0 ]]; then
|
19
19
|
if ! command -v bison >/dev/null ; then
|
20
|
-
$rvm_scripts_path/log "fail" "bison is not available in your path. Please ensure it exists before compiling from head."
|
20
|
+
"$rvm_scripts_path/log" "fail" "bison is not available in your path. Please ensure it exists before compiling from head."
|
21
21
|
return 1
|
22
22
|
fi
|
23
23
|
fi
|
@@ -27,9 +27,10 @@ __rvm_check_for_bison() {
|
|
27
27
|
# Expands patchsets etc.
|
28
28
|
__rvm_current_patch_names() {
|
29
29
|
# TODO: Lookup default patches on rvm_ruby_string heirarchy.
|
30
|
+
local patch_level_seperator="%"
|
30
31
|
local patches="$rvm_patch_names default"
|
31
|
-
for patch_name in $(
|
32
|
-
__rvm_expand_patch_name "$patch_name"
|
32
|
+
for patch_name in $(printf "$patches" | sed -e "s/,/ /g" -e "s#$patch_level_seperator#\\$patch_level_seperator#g" | __rvm_strip); do
|
33
|
+
__rvm_expand_patch_name "${patch_name//${patch_level_seperator}*/}"
|
33
34
|
done
|
34
35
|
}
|
35
36
|
|
@@ -44,17 +45,17 @@ __rvm_apply_patches() {
|
|
44
45
|
patch_level="1"
|
45
46
|
# If set, extract the patch level from the patch name.
|
46
47
|
if echo "$patch_name" | \grep -q "$patch_level_seperator"; then
|
47
|
-
patch_level="$
|
48
|
-
patch_name="$
|
48
|
+
patch_level="${patch_name/*${patch_level_seperator}/}"
|
49
|
+
patch_name="${patch_name/${patch_level_seperator}*/}"
|
49
50
|
fi
|
50
51
|
full_patch_path="$(__rvm_lookup_full_patch_path "$patch_name")"
|
51
52
|
# Expand paths, and for those we found we then apply the patches.
|
52
53
|
if [[ -n "$full_patch_path" ]]; then
|
53
|
-
__rvm_run "patch.apply.$
|
54
|
+
__rvm_run "patch.apply.${patch_name/*\/}" "patch -F$patch_fuzziness -p$patch_level -f <\"$full_patch_path\"" "Applying patch '$patch_name' (located at $full_patch_path)"
|
54
55
|
# Detect failed patches
|
55
56
|
[[ "$?" -gt 0 ]] && patch_result=1
|
56
57
|
else
|
57
|
-
$rvm_scripts_path/log "warn" "Patch '$patch_name' not found."
|
58
|
+
"$rvm_scripts_path/log" "warn" "Patch '$patch_name' not found."
|
58
59
|
patch_result=1
|
59
60
|
fi
|
60
61
|
done; unset patch_name full_patch_path patch_level
|
@@ -70,23 +71,22 @@ __rvm_install_source() {
|
|
70
71
|
__rvm_ensure_has_18_compat_ruby || return 1
|
71
72
|
fi
|
72
73
|
|
73
|
-
$rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
|
74
|
+
"$rvm_scripts_path/log" "info" "Installing Ruby from source to: $rvm_ruby_home"
|
74
75
|
__rvm_pushpop "$rvm_src_path"
|
75
76
|
if [[ -n "$rvm_force_flag" ]] ; then \rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
|
76
77
|
|
77
78
|
result=0
|
78
79
|
__rvm_fetch_ruby
|
79
80
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
80
|
-
$rvm_scripts_path/log "error" "There has been an error fetching the ruby interpreter. Aborting the installation." ; __rvm_pushpop ; return $result
|
81
|
+
"$rvm_scripts_path/log" "error" "There has been an error fetching the ruby interpreter. Aborting the installation." ; __rvm_pushpop ; return $result
|
81
82
|
fi
|
82
83
|
|
83
|
-
builtin cd $rvm_ruby_src_path
|
84
|
+
builtin cd "$rvm_ruby_src_path"
|
84
85
|
|
85
86
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
86
|
-
$rvm_scripts_path/log "error" "There has been an error, source directory is missing. Did the download or extraction fail? Aborting the installation." ; __rvm_pushpop ; return $result
|
87
|
+
"$rvm_scripts_path/log" "error" "There has been an error, source directory is missing. Did the download or extraction fail? Aborting the installation." ; __rvm_pushpop ; return $result
|
87
88
|
fi
|
88
89
|
|
89
|
-
|
90
90
|
if [[ -d "${rvm_path}/usr" ]] ; then
|
91
91
|
export PATH="${rvm_path}/usr/bin:${PATH}"
|
92
92
|
builtin hash -r
|
@@ -95,7 +95,7 @@ __rvm_install_source() {
|
|
95
95
|
__rvm_apply_patches
|
96
96
|
result="$?"
|
97
97
|
if [[ "$result" -gt 0 ]]; then
|
98
|
-
$rvm_scripts_path/log "fail" "There has been an error applying the specified patches. Aborting the installation."
|
98
|
+
"$rvm_scripts_path/log" "fail" "There has been an error applying the specified patches. Aborting the installation."
|
99
99
|
return $result
|
100
100
|
fi
|
101
101
|
|
@@ -103,14 +103,14 @@ __rvm_install_source() {
|
|
103
103
|
if command -v autoconf > /dev/null ; then
|
104
104
|
__rvm_run "autoconf" "autoconf" "Running autoconf"
|
105
105
|
else
|
106
|
-
result=$? ; $rvm_scripts_path/log "fail" "rvm requires autoconf to install the selected ruby interpreter however autoconf was not found in the PATH." ; return $result
|
106
|
+
result=$? ; "$rvm_scripts_path/log" "fail" "rvm requires autoconf to install the selected ruby interpreter however autoconf was not found in the PATH." ; return $result
|
107
107
|
fi
|
108
108
|
fi
|
109
109
|
|
110
110
|
if [[ -n "$rvm_ruby_configure" ]] ; then
|
111
111
|
__rvm_run "configure" "$rvm_ruby_configure"
|
112
112
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
113
|
-
$rvm_scripts_path/log "error" "There has been an error while configuring. Aborting the installation." ; __rvm_pushpop ; return $result
|
113
|
+
"$rvm_scripts_path/log" "error" "There has been an error while configuring. Aborting the installation." ; __rvm_pushpop ; return $result
|
114
114
|
fi
|
115
115
|
elif [[ -s ./configure ]] ; then
|
116
116
|
# REE stores configure flags differently for head vs. the distributed release.
|
@@ -131,16 +131,16 @@ __rvm_install_source() {
|
|
131
131
|
__rvm_run "configure" "$configure_command" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
132
132
|
unset configure_parameters db_configure_flags
|
133
133
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
134
|
-
$rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result
|
134
|
+
"$rvm_scripts_path/log" "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result
|
135
135
|
fi
|
136
136
|
else
|
137
|
-
$rvm_scripts_path/log "error" "Skipping configure step, 'configure' does not exist, did autoconf not run successfully?"
|
137
|
+
"$rvm_scripts_path/log" "error" "Skipping configure step, 'configure' does not exist, did autoconf not run successfully?"
|
138
138
|
fi
|
139
139
|
|
140
140
|
rvm_ruby_make=${rvm_ruby_make:-"make"}
|
141
141
|
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
142
142
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
143
|
-
$rvm_scripts_path/log "error" "There has been an error while running make. Aborting the installation." ; __rvm_pushpop ; return $result
|
143
|
+
"$rvm_scripts_path/log" "error" "There has been an error while running make. Aborting the installation." ; __rvm_pushpop ; return $result
|
144
144
|
fi
|
145
145
|
|
146
146
|
if [[ -d .ext/rdoc ]] ; then \rm -rf .ext/rdoc ; fi
|
@@ -148,10 +148,10 @@ __rvm_install_source() {
|
|
148
148
|
rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
|
149
149
|
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
150
150
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
151
|
-
$rvm_scripts_path/log "error" "There has been an error while running make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
151
|
+
"$rvm_scripts_path/log" "error" "There has been an error while running make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
152
152
|
fi
|
153
153
|
|
154
|
-
$rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete."
|
154
|
+
"$rvm_scripts_path/log" "info" "Installation of $rvm_ruby_string is complete."
|
155
155
|
|
156
156
|
export GEM_HOME="$rvm_ruby_gem_home"
|
157
157
|
export GEM_PATH="$rvm_ruby_gem_path"
|
@@ -180,7 +180,7 @@ __rvm_install_ruby() {
|
|
180
180
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
181
181
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
182
182
|
if [[ -n "$rvm_llvm_flag" ]] ; then
|
183
|
-
$rvm_scripts_path/package llvm install
|
183
|
+
"$rvm_scripts_path/package" llvm install
|
184
184
|
fi
|
185
185
|
macruby_path="/usr/local/bin"
|
186
186
|
# TODO: configure & make variables should be set here.
|
@@ -191,15 +191,15 @@ __rvm_install_ruby() {
|
|
191
191
|
rvm_ruby_repo_url=$rvm_url
|
192
192
|
__rvm_install_source $*
|
193
193
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
194
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to install from source. Aborting the installation." ; return $result
|
194
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to install from source. Aborting the installation." ; return $result
|
195
195
|
fi
|
196
196
|
elif [[ "nightly" = "$rvm_ruby_version" ]] ; then
|
197
197
|
macruby_path="/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin"
|
198
198
|
# TODO: Separated nightly from head.
|
199
|
-
$rvm_scripts_path/log "info" "Retrieving the latest nightly macruby build..."
|
200
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
199
|
+
"$rvm_scripts_path/log" "info" "Retrieving the latest nightly macruby build..."
|
200
|
+
"$rvm_scripts_path/fetch" "$rvm_url"
|
201
201
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
202
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
202
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
203
203
|
fi
|
204
204
|
mv "$rvm_archives_path/macruby_nightly-latest.pkg" "$rvm_archives_path/macruby_nightly.pkg"
|
205
205
|
__rvm_run "macruby/extract" "sudo /usr/sbin/installer -pkg '$rvm_archives_path/macruby_nightly.pkg' -target '/'"
|
@@ -207,13 +207,13 @@ __rvm_install_ruby() {
|
|
207
207
|
else
|
208
208
|
macruby_path="/Library/Frameworks/MacRuby.framework/Versions/${rvm_ruby_version}/usr/bin"
|
209
209
|
# TODO: Separated nightly from head.
|
210
|
-
$rvm_scripts_path/log "info" "Retrieving MacRuby ${rvm_ruby_version} ..."
|
211
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
210
|
+
"$rvm_scripts_path/log" "info" "Retrieving MacRuby ${rvm_ruby_version} ..."
|
211
|
+
"$rvm_scripts_path/fetch" "$rvm_url"
|
212
212
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
213
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
213
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
214
214
|
fi
|
215
215
|
\mkdir -p $rvm_ruby_src_path
|
216
|
-
unzip -o -j "$rvm_archives_path/$rvm_ruby_package_file" "MacRuby ${rvm_ruby_version}/MacRuby ${rvm_ruby_version}.pkg" -d "$rvm_ruby_src_path"
|
216
|
+
\unzip -o -j "$rvm_archives_path/$rvm_ruby_package_file" "MacRuby ${rvm_ruby_version}/MacRuby ${rvm_ruby_version}.pkg" -d "$rvm_ruby_src_path"
|
217
217
|
mv "$rvm_ruby_src_path/MacRuby ${rvm_ruby_version}.pkg" "$rvm_ruby_src_path/$rvm_ruby_string.pkg"
|
218
218
|
__rvm_run "macruby/extract" "sudo /usr/sbin/installer -pkg '$rvm_ruby_src_path/$rvm_ruby_string.pkg' -target '/'"
|
219
219
|
\mkdir -p "$rvm_ruby_home/bin"
|
@@ -230,44 +230,44 @@ export GEM_PATH="$rvm_ruby_gem_path"
|
|
230
230
|
export MY_RUBY_HOME="$rvm_ruby_home"
|
231
231
|
export PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:\$PATH"
|
232
232
|
|
233
|
-
exec $macruby_path/mac$binary_name $prefix "\$@"
|
233
|
+
exec "$macruby_path/mac$binary_name" "$prefix" "\$@"
|
234
234
|
RubyWrapper
|
235
235
|
)
|
236
236
|
|
237
237
|
file_name="$rvm_ruby_home/bin/$binary_name"
|
238
|
-
\rm -f $file_name
|
239
|
-
echo "$ruby_wrapper" > $file_name
|
240
|
-
if [[ -f $file_name ]] ; then chmod +x $file_name ; fi
|
238
|
+
\rm -f "$file_name"
|
239
|
+
echo "$ruby_wrapper" > "$file_name"
|
240
|
+
if [[ -f "$file_name" ]] ; then chmod +x $file_name ; fi
|
241
241
|
if [[ "$binary_name" = "ruby" ]] ; then
|
242
|
-
echo "$ruby_wrapper" > $rvm_bin_path/$rvm_ruby_string
|
242
|
+
echo "$ruby_wrapper" > "$rvm_bin_path/$rvm_ruby_string"
|
243
243
|
fi
|
244
244
|
unset file_name ruby_wrapper binary_name files prefix
|
245
245
|
done
|
246
246
|
__rvm_irbrc
|
247
247
|
else
|
248
|
-
$rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS."
|
248
|
+
"$rvm_scripts_path/log" "fail" "MacRuby can only be installed on a Darwin OS."
|
249
249
|
fi
|
250
250
|
;;
|
251
251
|
|
252
252
|
ree)
|
253
|
-
if [[ -n "$(echo $rvm_ruby_version | awk '/^1\.8/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
|
253
|
+
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.8/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
|
254
254
|
rvm_url="$(__rvm_db "ree_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz"
|
255
|
-
$rvm_scripts_path/log "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
|
255
|
+
"$rvm_scripts_path/log" "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
|
256
256
|
__rvm_pushpop "$rvm_src_path"
|
257
257
|
if [[ -z "$rvm_force_flag" ]] && [[ -d "$rvm_ruby_src_path" ]] && [[ ! -x "$rvm_ruby_src_path/installer" ]] ; then
|
258
|
-
$rvm_scripts_path/log "It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
|
258
|
+
"$rvm_scripts_path/log" "It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
|
259
259
|
else
|
260
|
-
$rvm_scripts_path/log "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
261
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
260
|
+
"$rvm_scripts_path/log" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
261
|
+
"$rvm_scripts_path/fetch" "$rvm_url"
|
262
262
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
263
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
263
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
264
264
|
fi
|
265
265
|
|
266
266
|
\rm -rf "$rvm_ruby_src_path"
|
267
267
|
__rvm_run "extract" "gunzip < \"$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension\" | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
|
268
268
|
|
269
269
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
270
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
270
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
271
271
|
fi
|
272
272
|
|
273
273
|
mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path"
|
@@ -276,7 +276,7 @@ RubyWrapper
|
|
276
276
|
|
277
277
|
\mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
|
278
278
|
if [[ -n "$rvm_ruby_configure_flags" ]] ; then
|
279
|
-
rvm_ruby_configure_flags="$
|
279
|
+
rvm_ruby_configure_flags="${rvm_ruby_configure_flags//--/-c --}"
|
280
280
|
fi
|
281
281
|
|
282
282
|
if [[ "Darwin" = "$(uname)" ]] && [[ "1.8.6" = "$rvm_ruby_version" ]] && [[ -z "$rvm_ree_options" ]] ; then
|
@@ -287,15 +287,15 @@ RubyWrapper
|
|
287
287
|
|
288
288
|
__rvm_apply_patches "$rvm_ruby_src_path/source"
|
289
289
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
290
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to apply patches to ree. Aborting the installation." ; __rvm_pushpop ; return $result
|
290
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to apply patches to ree. Aborting the installation." ; __rvm_pushpop ; return $result
|
291
291
|
fi
|
292
292
|
|
293
293
|
__rvm_run "install" "./installer -a $rvm_rubies_path/$rvm_ruby_string $rvm_ree_options $db_configure_flags $rvm_ruby_configure_flags" "Installing $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
294
294
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
295
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to run the ree installer. Aborting the installation." ; __rvm_pushpop ; return $result
|
295
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to run the ree installer. Aborting the installation." ; __rvm_pushpop ; return $result
|
296
296
|
fi
|
297
297
|
|
298
|
-
chmod +x $rvm_ruby_home/bin/*
|
298
|
+
chmod +x "$rvm_ruby_home"/bin/*
|
299
299
|
|
300
300
|
__rvm_rubygems_setup
|
301
301
|
__rvm_irbrc
|
@@ -305,10 +305,10 @@ RubyWrapper
|
|
305
305
|
else
|
306
306
|
__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_repo_url" "rvm_url"
|
307
307
|
if [[ -z "$rvm_url" ]] ; then
|
308
|
-
$rvm_scripts_path/log "fail" "rvm does not know the rvm repo url for '${rvm_ruby_interpreter}_${rvm_ruby_version}'"
|
308
|
+
"$rvm_scripts_path/log" "fail" "rvm does not know the rvm repo url for '${rvm_ruby_interpreter}_${rvm_ruby_version}'"
|
309
309
|
result=1
|
310
310
|
else
|
311
|
-
rvm_ruby_repo_url
|
311
|
+
rvm_ruby_repo_url="$rvm_url"
|
312
312
|
if [[ "rvm_make_flags_flag" -eq 1 ]] ; then __rvm_make_flags ; fi
|
313
313
|
__rvm_install_source $*
|
314
314
|
fi
|
@@ -316,7 +316,7 @@ RubyWrapper
|
|
316
316
|
;;
|
317
317
|
|
318
318
|
rbx|rubinius)
|
319
|
-
$rvm_scripts_path/log "info" "Installing pre-requisites"
|
319
|
+
"$rvm_scripts_path/log" "info" "Installing pre-requisites"
|
320
320
|
|
321
321
|
# Ensure we have a 1.8.7 compatible ruby installed.
|
322
322
|
__rvm_ensure_has_18_compat_ruby || return 1
|
@@ -329,15 +329,15 @@ RubyWrapper
|
|
329
329
|
builtin hash -r
|
330
330
|
|
331
331
|
if [[ -n "$(echo $rvm_ruby_version | awk '/^1\.0/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
|
332
|
-
$rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
333
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
332
|
+
"$rvm_scripts_path/log" "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
333
|
+
"$rvm_scripts_path/fetch" "$rvm_url"
|
334
334
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
335
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
335
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
336
336
|
fi
|
337
337
|
__rvm_run "extract" "gunzip < \"$rvm_archives_path/$(basename $rvm_ruby_package_file)\" | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
|
338
338
|
|
339
339
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
340
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
340
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
341
341
|
fi
|
342
342
|
|
343
343
|
# Remove the left over folder first.
|
@@ -348,7 +348,7 @@ RubyWrapper
|
|
348
348
|
#rvm_ruby_home="$rvm_rubies_path/$rvm_ruby_interpreter-$rvm_ruby_version"
|
349
349
|
__rvm_fetch_from_github "rbx"
|
350
350
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
351
|
-
$rvm_scripts_path/log "error" "There has been an error while fetching the rbx git repo. Aborting the installation." ; __rvm_pushpop ; return $result
|
351
|
+
"$rvm_scripts_path/log" "error" "There has been an error while fetching the rbx git repo. Aborting the installation." ; __rvm_pushpop ; return $result
|
352
352
|
fi
|
353
353
|
fi
|
354
354
|
|
@@ -356,7 +356,7 @@ RubyWrapper
|
|
356
356
|
|
357
357
|
__rvm_apply_patches
|
358
358
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
359
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to apply patches to rubinius. Aborting the installation." ; __rvm_pushpop ; return $result
|
359
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to apply patches to rubinius. Aborting the installation." ; __rvm_pushpop ; return $result
|
360
360
|
fi
|
361
361
|
|
362
362
|
__rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags"
|
@@ -374,7 +374,7 @@ RubyWrapper
|
|
374
374
|
fi
|
375
375
|
__rvm_run "configure" "$rvm_ruby_configure" "$message"
|
376
376
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
377
|
-
$rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
377
|
+
"$rvm_scripts_path/log" "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
378
378
|
fi
|
379
379
|
|
380
380
|
if [[ "$rvm_trace_flag" -eq 1 ]] ; then
|
@@ -384,10 +384,8 @@ RubyWrapper
|
|
384
384
|
fi
|
385
385
|
__rvm_run "rake" "$rvm_ruby_make" "$message"
|
386
386
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
387
|
-
$rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
388
|
-
fi
|
389
|
-
|
390
|
-
unset ruby
|
387
|
+
"$rvm_scripts_path/log" "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
388
|
+
fi ; unset ruby
|
391
389
|
|
392
390
|
# Symlink rubinius wrappers
|
393
391
|
ln -fs "$rvm_ruby_home/bin/rbx" "$rvm_ruby_home/bin/ruby"
|
@@ -417,17 +415,17 @@ RubyWrapper
|
|
417
415
|
printf "java must be installed and in your path in order to install JRuby." ; return 1
|
418
416
|
fi
|
419
417
|
|
420
|
-
__rvm_pushpop $rvm_src_path
|
418
|
+
__rvm_pushpop "$rvm_src_path"
|
421
419
|
__rvm_fetch_ruby
|
422
420
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
423
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
421
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
424
422
|
fi
|
425
423
|
|
426
424
|
builtin cd "$rvm_ruby_src_path"
|
427
425
|
if [[ -n "$rvm_head_flag" ]] ; then __rvm_run "ant.dist" "ant dist" "Running 'ant dist' (this could take a few minutes) ..." ; fi
|
428
426
|
|
429
427
|
\mkdir -p "$rvm_ruby_home/bin/"
|
430
|
-
if $rvm_scripts_path/match "$rvm_ruby_version" "1\.3" || $rvm_scripts_path/match "$rvm_ruby_version" "1\.2" ; then
|
428
|
+
if "$rvm_scripts_path/match" "$rvm_ruby_version" "1\.3" || "$rvm_scripts_path/match" "$rvm_ruby_version" "1\.2" ; then
|
431
429
|
__rvm_run "nailgun" "builtin cd \"$rvm_ruby_src_path/tool/nailgun\" && make $rvm_make_flags" "Building Nailgun"
|
432
430
|
else
|
433
431
|
__rvm_run "nailgun" "builtin cd \"$rvm_ruby_src_path/tool/nailgun\" && ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags" "Building Nailgun"
|
@@ -437,22 +435,22 @@ RubyWrapper
|
|
437
435
|
|
438
436
|
if [[ -z "$rvm_ruby_home" ]] || [[ "$rvm_ruby_home" = "/" ]] ; then echo "WTH?!?! rvm_ruby_home == / ??? not removing." ; return 1000000 ; fi
|
439
437
|
|
440
|
-
\rm -rf $rvm_ruby_home
|
438
|
+
\rm -rf "$rvm_ruby_home"
|
441
439
|
__rvm_run "install" "/bin/cp -Rf $rvm_ruby_src_path $rvm_ruby_home" "Installing JRuby to $rvm_ruby_home"
|
442
440
|
|
443
|
-
__rvm_pushpop $rvm_ruby_home/bin/
|
441
|
+
__rvm_pushpop "$rvm_ruby_home/bin/"
|
444
442
|
for binary in jirb jruby jgem ; do
|
445
|
-
ln -nfs $binary ${binary#j}
|
443
|
+
ln -nfs "$binary" "${binary#j}"
|
446
444
|
done ; unset binary
|
447
445
|
__rvm_pushpop
|
448
446
|
|
449
447
|
# -server is "a lot slower for short-lived scripts like rake tasks, and takes longer to load"
|
450
448
|
#sed -e 's#^JAVA_VM=-client#JAVA_VM=-server#' $rvm_ruby_home/bin/jruby > $rvm_ruby_home/bin/jruby.new &&
|
451
449
|
# mv $rvm_ruby_home/bin/jruby.new $rvm_ruby_home/bin/jruby
|
452
|
-
chmod +x $rvm_ruby_home/bin/jruby
|
450
|
+
chmod +x "$rvm_ruby_home/bin/jruby"
|
453
451
|
|
454
452
|
for binary in jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb ; do
|
455
|
-
__rvm_inject_gem_env $rvm_ruby_home/bin/$binary
|
453
|
+
__rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
|
456
454
|
done ; unset binary
|
457
455
|
|
458
456
|
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/rake"
|
@@ -466,7 +464,7 @@ RubyWrapper
|
|
466
464
|
|
467
465
|
# jruby ships with some built in gems, copy them in to place.
|
468
466
|
if [[ -d "$rvm_ruby_home/lib/ruby/gems/1.8" ]]; then
|
469
|
-
$rvm_scripts_path/log "info" "Copying across included gems"
|
467
|
+
"$rvm_scripts_path/log" "info" "Copying across included gems"
|
470
468
|
cp -R "$rvm_ruby_home/lib/ruby/gems/1.8/" "$GEM_HOME/"
|
471
469
|
fi
|
472
470
|
|
@@ -475,32 +473,32 @@ RubyWrapper
|
|
475
473
|
maglev)
|
476
474
|
__rvm_ensure_has_18_compat_ruby
|
477
475
|
|
478
|
-
$rvm_scripts_path/log "info" "Running MagLev prereqs checking script."
|
479
|
-
$rvm_scripts_path/maglev
|
476
|
+
"$rvm_scripts_path/log" "info" "Running MagLev prereqs checking script."
|
477
|
+
"$rvm_scripts_path/maglev"
|
480
478
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
481
|
-
$rvm_scripts_path/log "error" "Prerequisite checks have failed. Aborting the installation." ; __rvm_pushpop ; return $result
|
479
|
+
"$rvm_scripts_path/log" "error" "Prerequisite checks have failed. Aborting the installation." ; __rvm_pushpop ; return $result
|
482
480
|
fi
|
483
481
|
|
484
|
-
__rvm_pushpop $rvm_src_path
|
482
|
+
__rvm_pushpop "$rvm_src_path"
|
485
483
|
|
486
484
|
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ -n "$rvm_force_flag" ]] ; then
|
487
485
|
\rm -rf "$rvm_src_path/$rvm_ruby_string/" "$rvm_src_path/$rvm_ruby_string/"
|
488
486
|
__rvm_fetch_ruby
|
489
487
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
490
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
488
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
491
489
|
fi
|
492
490
|
fi
|
493
491
|
|
494
492
|
if [[ -n "$rvm_head_flag" ]] ; then
|
495
|
-
builtin cd $rvm_ruby_src_path
|
493
|
+
builtin cd "$rvm_ruby_src_path"
|
496
494
|
rvm_gemstone_package_file="GemStone-$(\grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | \tr ' ' '-')"
|
497
495
|
rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
|
498
496
|
fi
|
499
497
|
|
500
|
-
$rvm_scripts_path/log "info" "Downloading the GemStone package, this may take a while depending on your connection..."
|
501
|
-
$rvm_scripts_path/fetch "$rvm_gemstone_url"
|
498
|
+
"$rvm_scripts_path/log" "info" "Downloading the GemStone package, this may take a while depending on your connection..."
|
499
|
+
"$rvm_scripts_path/fetch" "$rvm_gemstone_url"
|
502
500
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
503
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
|
501
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
|
504
502
|
fi
|
505
503
|
|
506
504
|
builtin cd "$rvm_src_path"
|
@@ -513,7 +511,7 @@ RubyWrapper
|
|
513
511
|
|
514
512
|
__rvm_run "gemstone.extract" "gunzip < \"$rvm_archives_path/${rvm_gemstone_package_file}.${rvm_archive_extension}\" | tar xf - -C $rvm_ruby_src_path"
|
515
513
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
516
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to extract the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
|
514
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to extract the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
|
517
515
|
fi
|
518
516
|
|
519
517
|
chmod -R 777 "$rvm_gemstone_package_file" # for now.
|
@@ -525,20 +523,20 @@ RubyWrapper
|
|
525
523
|
\rm -rf $rvm_ruby_home
|
526
524
|
__rvm_run "install" "/bin/cp -Rf $rvm_ruby_src_path $rvm_ruby_home" "Installing maglev to $rvm_ruby_home"
|
527
525
|
|
528
|
-
__rvm_pushpop $rvm_ruby_home/bin/
|
526
|
+
__rvm_pushpop "$rvm_ruby_home/bin/"
|
529
527
|
for binary in maglev-irb maglev-ruby maglev-gem ; do
|
530
|
-
ln -nfs $binary ${binary#maglev-}
|
528
|
+
ln -nfs "$binary" "${binary#maglev-}"
|
531
529
|
done ; unset binary
|
532
530
|
__rvm_pushpop
|
533
531
|
|
534
532
|
for binary in maglev-ruby maglev-irb maglev-gem ; do
|
535
|
-
__rvm_inject_gem_env $rvm_ruby_home/bin/$binary
|
533
|
+
__rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
|
536
534
|
done ; unset binary
|
537
535
|
|
538
536
|
builtin cd "$rvm_ruby_home"
|
539
537
|
if [[ -n "$rvm_head_flag" ]] ; then
|
540
538
|
git submodule update --init
|
541
|
-
$rvm_ruby_home/bin/maglev force-reload
|
539
|
+
"$rvm_ruby_home/bin/maglev" force-reload
|
542
540
|
ln -sf maglev.demo.key-$(uname -sm | \tr ' ' '-') etc/maglev.demo.key
|
543
541
|
fi
|
544
542
|
|
@@ -547,15 +545,15 @@ RubyWrapper
|
|
547
545
|
compatible_ruby="$(__rvm_18_compat_ruby)"
|
548
546
|
|
549
547
|
if [[ ! -e ${rvm_ruby_home}/etc/conf.d/maglev.conf ]] ; then
|
550
|
-
$rvm_scripts_path/log "info" "Creating default 'maglev' repository."
|
551
|
-
$rvm_wrappers_path/$compatible_ruby/rake "stone:create[maglev]" >/dev/null 2>&1
|
548
|
+
"$rvm_scripts_path/log" "info" "Creating default 'maglev' repository."
|
549
|
+
"$rvm_wrappers_path/$compatible_ruby/rake" "stone:create[maglev]" >/dev/null 2>&1
|
552
550
|
fi
|
553
551
|
|
554
|
-
$rvm_scripts_path/log "info" "Generating maglev HTML documentation"
|
555
|
-
$rvm_wrappers_path/$compatible_ruby/rake rdoc >/dev/null 2>&1
|
552
|
+
"$rvm_scripts_path/log" "info" "Generating maglev HTML documentation"
|
553
|
+
"$rvm_wrappers_path/$compatible_ruby/rake" rdoc >/dev/null 2>&1
|
556
554
|
|
557
|
-
$rvm_scripts_path/log "info" "Generating smalltalk FFI."
|
558
|
-
$rvm_wrappers_path/$compatible_ruby/rake stwrappers >/dev/null 2>&1
|
555
|
+
"$rvm_scripts_path/log" "info" "Generating smalltalk FFI."
|
556
|
+
"$rvm_wrappers_path/$compatible_ruby/rake" stwrappers >/dev/null 2>&1
|
559
557
|
|
560
558
|
unset compatible_ruby
|
561
559
|
|
@@ -573,9 +571,9 @@ RubyWrapper
|
|
573
571
|
|
574
572
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
575
573
|
mono_version="$(mono -V | head -n 1 | cut -d ' ' -f5)"
|
576
|
-
if $rvm_scripts_path/match "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then
|
577
|
-
mono_major_ver="$(echo $mono_version | cut -d '.' -f1)"
|
578
|
-
mono_minor_ver="$(echo $mono_version | cut -d '.' -f2)"
|
574
|
+
if "$rvm_scripts_path/match" "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then
|
575
|
+
mono_major_ver="$(echo "$mono_version" | cut -d '.' -f1)"
|
576
|
+
mono_minor_ver="$(echo "$mono_version" | cut -d '.' -f2)"
|
579
577
|
if [[ $mono_major_ver -lt 2 ]] || ( [[ $mono_major_ver -eq 2 ]] && [[ $mono_minor_ver -lt 6 ]] ) ; then
|
580
578
|
printf "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository."
|
581
579
|
printf "Version detected: ${mono_version}"
|
@@ -590,11 +588,11 @@ RubyWrapper
|
|
590
588
|
|
591
589
|
__rvm_fetch_ruby
|
592
590
|
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
|
593
|
-
builtin cd $rvm_ruby_src_path
|
591
|
+
builtin cd "$rvm_ruby_src_path"
|
594
592
|
|
595
593
|
compatible_ruby="$(__rvm_18_compat_ruby)"
|
596
594
|
|
597
|
-
$rvm_wrappers_path/$compatible_ruby/gem install pathname2 --no-rdoc --no-ri
|
595
|
+
"$rvm_wrappers_path/$compatible_ruby/gem" install pathname2 --no-rdoc --no-ri
|
598
596
|
|
599
597
|
# MONO_LIB=/Library/Frameworks/Mono.framework/Versions/current/lib/
|
600
598
|
rvm_ruby_make="$rvm_wrappers_path/$compatible_ruby/rake MERLIN_ROOT=\"$rvm_ruby_src_path/Merlin/Main\" compile mono=1 configuration=release --trace"
|
@@ -602,46 +600,46 @@ RubyWrapper
|
|
602
600
|
unset compatible_ruby
|
603
601
|
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
|
604
602
|
|
605
|
-
\rm -rf $rvm_ruby_home/*
|
606
|
-
\mkdir -p $rvm_ruby_home/bin $rvm_ruby_home/lib $rvm_ruby_home/lib/ruby $rvm_ruby_home/lib/IronRuby
|
603
|
+
\rm -rf "$rvm_ruby_home"/*
|
604
|
+
\mkdir -p "$rvm_ruby_home/bin" "$rvm_ruby_home/lib" "$rvm_ruby_home/lib/ruby" "$rvm_ruby_home/lib/IronRuby"
|
607
605
|
|
608
|
-
\cp -r $rvm_ruby_src_path/Merlin/Main/Bin/mono_release/* $rvm_ruby_home/bin/
|
609
|
-
\cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/
|
610
|
-
\cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/* $rvm_ruby_home/lib/ruby
|
611
|
-
\cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs/* $rvm_ruby_home/lib/IronRuby
|
606
|
+
\cp -r "$rvm_ruby_src_path/Merlin/Main/Bin/mono_release"/* "$rvm_ruby_home/bin/"
|
607
|
+
\cp -r "$rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin"/* "$rvm_ruby_home/bin/"
|
608
|
+
\cp -r "$rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby"/* "$rvm_ruby_home/lib/ruby"
|
609
|
+
\cp -r "$rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs"/* "$rvm_ruby_home/lib/IronRuby"
|
612
610
|
else
|
613
|
-
$rvm_scripts_path/log "info" "Retrieving IronRuby"
|
611
|
+
"$rvm_scripts_path/log" "info" "Retrieving IronRuby"
|
614
612
|
|
615
|
-
$rvm_scripts_path/fetch "$rvm_url" "$rvm_ruby_package_file"
|
613
|
+
"$rvm_scripts_path/fetch" "$rvm_url" "$rvm_ruby_package_file"
|
616
614
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
617
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
615
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
618
616
|
fi
|
619
617
|
|
620
|
-
\mkdir -p $rvm_ruby_src_path $rvm_ruby_home
|
621
|
-
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"
|
618
|
+
\mkdir -p "$rvm_ruby_src_path" "$rvm_ruby_home"
|
619
|
+
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"
|
622
620
|
result=$? ; if [[ "$result" -gt 1 ]] ; then
|
623
|
-
$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
|
621
|
+
"$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
|
624
622
|
fi
|
625
623
|
|
626
624
|
for dir in bin lib silverlight ; do
|
627
|
-
\cp -Rf $rvm_src_path/$rvm_ruby_string/$dir "$rvm_ruby_home/$dir"
|
625
|
+
\cp -Rf "$rvm_src_path/$rvm_ruby_string/$dir" "$rvm_ruby_home/$dir"
|
628
626
|
done
|
629
627
|
fi
|
630
628
|
|
631
629
|
binaries=(gem irb rdoc rake ri ruby)
|
632
630
|
for binary_name in ${binaries[@]} ; do
|
633
|
-
if [[ -s $rvm_ruby_home/bin/$binary_name ]] ; then
|
631
|
+
if [[ -s "$rvm_ruby_home/bin/$binary_name" ]] ; then
|
634
632
|
\tr -d '\r' < "$rvm_ruby_home/bin/$binary_name" > "$rvm_ruby_home/bin/$binary_name.new"
|
635
633
|
#sed -e '1,1s=.*=#!'"/usr/bin/env ir=" "$rvm_ruby_home/bin/$binary_name" > "$rvm_ruby_home/bin/$binary_name.new"
|
636
634
|
mv -f "$rvm_ruby_home/bin/$binary_name.new" "$rvm_ruby_home/bin/$binary_name"
|
637
|
-
chmod +x $rvm_ruby_home/bin/$binary_name
|
635
|
+
chmod +x "$rvm_ruby_home/bin/$binary_name"
|
638
636
|
fi
|
639
637
|
done
|
640
638
|
|
641
639
|
sed -e '1,1s=.*=#!'"/usr/bin/env bash=" "$rvm_ruby_home/bin/ir" | \tr -d '\r' > "$rvm_ruby_home/bin/ir.new"
|
642
640
|
mv -f "$rvm_ruby_home/bin/ir.new" "$rvm_ruby_home/bin/ir"
|
643
|
-
chmod +x $rvm_ruby_home/bin/ir
|
644
|
-
ln -fs $rvm_ruby_home/bin/ir $rvm_ruby_home/bin/ruby
|
641
|
+
chmod +x "$rvm_ruby_home/bin/ir"
|
642
|
+
ln -fs "$rvm_ruby_home/bin/ir" "$rvm_ruby_home/bin/ruby"
|
645
643
|
builtin hash -r
|
646
644
|
__rvm_run "gems.install" "PATH=$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:$PATH GEM_HOME=$rvm_ruby_gem_home GEM_PATH=$rvm_ruby_gem_home $rvm_ruby_home/bin/gem install --no-rdoc --no-ri rake $rvm_gem_options" "Installing $rvm_gem_name to $dir"
|
647
645
|
;;
|
@@ -659,48 +657,48 @@ RubyWrapper
|
|
659
657
|
|
660
658
|
__rvm_apply_patches
|
661
659
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
662
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to apply patches to mput. Aborting the installation." ; return $result
|
660
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to apply patches to mput. Aborting the installation." ; return $result
|
663
661
|
fi
|
664
662
|
|
665
663
|
if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
|
666
664
|
if command -v autoconf &> /dev/null ; then
|
667
665
|
__rvm_run "autoconf" "autoconf" "Running autoconf"
|
668
666
|
else
|
669
|
-
result=$?; $rvm_scripts_path/log "fail" "rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. Aborting installation." ; return $result
|
667
|
+
result=$?; "$rvm_scripts_path/log" "fail" "rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. Aborting installation." ; return $result
|
670
668
|
fi
|
671
669
|
fi
|
672
670
|
|
673
671
|
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
|
674
|
-
(($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
|
672
|
+
(($rvm_debug_flag)) && "$rvm_scripts_path/log" "debug" "Skipping configure step, Makefile exists so configure must have already been run."
|
675
673
|
elif [[ -n "$rvm_ruby_configure" ]] ; then
|
676
674
|
__rvm_run "configure" "$rvm_ruby_configure"
|
677
675
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
678
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
676
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
679
677
|
fi
|
680
678
|
|
681
679
|
elif [[ -s ./configure ]] ; then
|
682
680
|
local configure_command="./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags"
|
683
681
|
__rvm_run "configure" "" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..."
|
684
682
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
685
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
683
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
686
684
|
fi
|
687
685
|
else
|
688
|
-
$rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
|
686
|
+
"$rvm_scripts_path/log" "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
|
689
687
|
fi
|
690
688
|
|
691
689
|
rvm_ruby_make=${rvm_ruby_make:-"make"}
|
692
690
|
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
693
691
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
694
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to run make. Aborting the installation." ; __rvm_pushpop ; return $result
|
692
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to run make. Aborting the installation." ; __rvm_pushpop ; return $result
|
695
693
|
fi
|
696
694
|
|
697
695
|
rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
|
698
696
|
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
699
697
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
700
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to run make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
698
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to run make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
701
699
|
fi
|
702
700
|
|
703
|
-
$rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete."
|
701
|
+
"$rvm_scripts_path/log" "info" "Installation of $rvm_ruby_string is complete."
|
704
702
|
|
705
703
|
export GEM_HOME="$rvm_ruby_gem_home"
|
706
704
|
export GEM_PATH="$rvm_ruby_gem_path"
|
@@ -722,16 +720,16 @@ RubyWrapper
|
|
722
720
|
;;
|
723
721
|
|
724
722
|
default)
|
725
|
-
$rvm_scripts_path/log "fail" "must specify a ruby interpreter to install."
|
723
|
+
"$rvm_scripts_path/log" "fail" "must specify a ruby interpreter to install."
|
726
724
|
;;
|
727
725
|
|
728
|
-
*) $rvm_scripts_path/log "fail" "Ruby interpreter '$rvm_ruby_interpreter' is not known."
|
726
|
+
*) "$rvm_scripts_path/log" "fail" "Ruby interpreter '$rvm_ruby_interpreter' is not known."
|
729
727
|
|
730
728
|
esac
|
731
729
|
|
732
|
-
rvm_hook="after_install" ; source $rvm_scripts_path/hook
|
730
|
+
rvm_hook="after_install" ; source "$rvm_scripts_path/hook"
|
733
731
|
|
734
|
-
if [[ -n "$ruby_options" ]] ; then RUBYOPT
|
732
|
+
if [[ -n "$ruby_options" ]] ; then RUBYOPT="$ruby_options" ; export RUBYOPT ; fi
|
735
733
|
}
|
736
734
|
|
737
735
|
__rvm_fetch_from_github() {
|
@@ -741,8 +739,8 @@ __rvm_fetch_from_github() {
|
|
741
739
|
builtin cd "$rvm_home"
|
742
740
|
__rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_url"
|
743
741
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
744
|
-
rvm_ruby_repo_http_url="$
|
745
|
-
$rvm_scripts_path/log "info" "Could not fetch $rvm_ruby_repo_url - trying $rvm_ruby_repo_http_url"
|
742
|
+
rvm_ruby_repo_http_url="${rvm_ruby_repo_url//git:/http:}"
|
743
|
+
"$rvm_scripts_path/log" "info" "Could not fetch $rvm_ruby_repo_url - trying $rvm_ruby_repo_http_url"
|
746
744
|
__rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_http_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_http_url"
|
747
745
|
fi
|
748
746
|
else
|
@@ -793,69 +791,69 @@ __rvm_fetch_ruby() {
|
|
793
791
|
if [[ "tar.gz" = "$rvm_archive_extension" ]] || [[ "tgz" = "$rvm_archive_extension" ]] ; then
|
794
792
|
__rvm_run "extract" "gunzip < \"$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension\" | tar xf - -C /tmp/rvm_src_$$" "Extracting $rvm_ruby_package_file ..."
|
795
793
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
796
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
794
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
797
795
|
fi
|
798
796
|
elif [[ "zip" = "$rvm_archive_extension" ]] ; then
|
799
797
|
__rvm_run "extract" "unzip -q -o $rvm_archives_path/$rvm_ruby_package_file -d /tmp/rvm_src_$$"
|
800
798
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
801
|
-
$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
|
799
|
+
"$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
|
802
800
|
fi
|
803
801
|
elif [[ "tar.bz2" = "$rvm_archive_extension" ]] ; then
|
804
802
|
__rvm_run "extract" "bunzip2 < \"$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension\" | tar xf - -C /tmp/rvm_src_$$" "Extracting $rvm_ruby_package_file ..."
|
805
803
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
806
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
804
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
807
805
|
fi
|
808
806
|
fi
|
809
807
|
|
810
808
|
mv "/tmp/rvm_src_$$/$(\cd /tmp/rvm_src_$$ ; \ls)" "$rvm_ruby_src_path" ; \rm -rf "/tmp/rvm_src_$$"
|
811
809
|
|
812
810
|
if [[ -n "$rvm_ruby_name" ]] && [[ -d "$rvm_src_path/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" ]] ; then
|
813
|
-
mv "$rvm_src_path/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" "$rvm_ruby_src_path"
|
811
|
+
mv "$rvm_src_path/$(echo "$rvm_ruby_string" | sed -e 's/-n.*//')" "$rvm_ruby_src_path"
|
814
812
|
fi
|
815
813
|
|
816
814
|
else
|
817
|
-
$rvm_scripts_path/log "info" "$rvm_ruby_src_path has already been extracted." ; __rvm_pushpop ; return 0
|
815
|
+
"$rvm_scripts_path/log" "info" "$rvm_ruby_src_path has already been extracted." ; __rvm_pushpop ; return 0
|
818
816
|
fi
|
819
817
|
|
820
818
|
else
|
821
819
|
|
822
820
|
\mkdir -p "$rvm_repo_path"
|
823
|
-
if [[ -n "$(echo $rvm_url | awk '/^git/')" ]] ; then
|
821
|
+
if [[ -n "$(echo "$rvm_url" | awk '/^git/')" ]] ; then
|
824
822
|
if [[ -d "$rvm_ruby_repo_path/.git" ]] ; then
|
825
|
-
builtin cd $rvm_ruby_repo_path
|
823
|
+
builtin cd "$rvm_ruby_repo_path"
|
826
824
|
if [[ -z "$rvm_ruby_revision" ]] ; then
|
827
|
-
$rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
825
|
+
"$rvm_scripts_path/log" "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
828
826
|
git pull origin master --force
|
829
827
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
830
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to update the source from the remote repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
828
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to update the source from the remote repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
831
829
|
fi
|
832
830
|
else
|
833
831
|
if [[ -z "$rvm_ruby_sha" ]] ; then
|
834
832
|
git checkout HEAD
|
835
833
|
else
|
836
|
-
git checkout $(echo $rvm_ruby_sha | sed 's#^s##')
|
834
|
+
git checkout $(echo "$rvm_ruby_sha" | sed 's#^s##')
|
837
835
|
fi
|
838
836
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
839
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to checkout the source branch. Aborting the installation." ; __rvm_pushpop ; return $result
|
837
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to checkout the source branch. Aborting the installation." ; __rvm_pushpop ; return $result
|
840
838
|
fi
|
841
839
|
fi
|
842
840
|
else
|
843
841
|
\rm -rf "$rvm_ruby_repo_path"
|
844
|
-
rvm_ruby_repo_http_url="$
|
845
|
-
$rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
842
|
+
rvm_ruby_repo_http_url="${rvm_ruby_repo_url//git:/http:/}"
|
843
|
+
"$rvm_scripts_path/log" "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
846
844
|
git clone --depth 1 "$rvm_ruby_repo_url" "$rvm_ruby_repo_path"
|
847
845
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
848
|
-
$rvm_scripts_path/log "info" "cloning from $rvm_ruby_repo_url failed, now attempting to clone from $rvm_ruby_repo_http_url, this may take a while depending on your connection..."
|
846
|
+
"$rvm_scripts_path/log" "info" "cloning from $rvm_ruby_repo_url failed, now attempting to clone from $rvm_ruby_repo_http_url, this may take a while depending on your connection..."
|
849
847
|
git clone "$rvm_ruby_repo_http_url" "$rvm_ruby_repo_path"
|
850
848
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
851
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
849
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
852
850
|
fi
|
853
851
|
fi
|
854
852
|
fi
|
855
853
|
else
|
856
854
|
if [[ -n "$rvm_ruby_tag" ]] ; then
|
857
855
|
# TODO: Check if tag v is valid
|
858
|
-
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/tags/$(echo $rvm_ruby_tag | sed 's/^t//')"}"
|
856
|
+
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/tags/$(echo "$rvm_ruby_tag" | sed 's/^t//')"}"
|
859
857
|
elif [[ -z "$rvm_ruby_version" ]] && [[ -n "$rvm_head_flag" ]] ; then
|
860
858
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/trunk"}"
|
861
859
|
elif [[ "$rvm_major_version" = "9" ]] ; then
|
@@ -869,39 +867,38 @@ __rvm_fetch_ruby() {
|
|
869
867
|
else
|
870
868
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/branches/ruby_${rvm_release_version}_${rvm_major_version}_${rvm_minor_version}"}"
|
871
869
|
fi
|
872
|
-
|
873
870
|
rvm_rev=""
|
874
871
|
if [ -n "$rvm_ruby_revision" ] ; then
|
875
872
|
rvm_rev="-$rvm_ruby_revision"
|
876
873
|
fi
|
877
874
|
|
878
875
|
if [[ -d "$rvm_ruby_repo_path/.svn" ]] ; then
|
879
|
-
builtin cd $rvm_ruby_repo_path
|
880
|
-
$rvm_scripts_path/log "info" "Updating ruby from $rvm_url"
|
876
|
+
builtin cd "$rvm_ruby_repo_path"
|
877
|
+
"$rvm_scripts_path/log" "info" "Updating ruby from $rvm_url"
|
881
878
|
__rvm_run "svn.switch" "svn switch $rvm_url"
|
882
879
|
__rvm_run "svn.update" "svn update"
|
883
880
|
if [[ -n "$rvm_rev" ]] ; then
|
884
|
-
$rvm_scripts_path/log "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
|
881
|
+
"$rvm_scripts_path/log" "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
|
885
882
|
__rvm_run "svn.checkout" "svn update -q ${rvm_rev/-r/-r }"
|
886
883
|
fi
|
887
884
|
else
|
888
|
-
\rm -rf $rvm_ruby_repo_path
|
885
|
+
\rm -rf "$rvm_ruby_repo_path"
|
889
886
|
__rvm_run "svn.checkout" "svn checkout -q ${rvm_rev/-r/-r } $rvm_url $rvm_ruby_repo_path" "Downloading source from ${rvm_url}."
|
890
887
|
fi
|
891
888
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
892
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch / update the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
889
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch / update the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
893
890
|
fi
|
894
891
|
|
895
892
|
fi
|
896
|
-
$rvm_scripts_path/log "info" "Copying from repo to src path..."
|
893
|
+
"$rvm_scripts_path/log" "info" "Copying from repo to src path..."
|
897
894
|
\rm -rf "$rvm_ruby_src_path"
|
898
895
|
\cp -R "$rvm_ruby_repo_path" "$rvm_ruby_src_path"
|
899
896
|
fi
|
900
897
|
}
|
901
898
|
|
902
899
|
__rvm_check_default() {
|
903
|
-
default_ruby_interpreter="$(rvm alias show default 2>/dev/null | awk -F"${
|
904
|
-
current_ruby_interpreter="$(echo "$rvm_ruby_string" | awk -F"${
|
900
|
+
default_ruby_interpreter="$(rvm alias show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
|
901
|
+
current_ruby_interpreter="$(echo "$rvm_ruby_string" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
|
905
902
|
if [[ -n "$current_ruby_interpreter" && "$current_ruby_interpreter" == "$default_ruby_interpreter" ]]; then
|
906
903
|
__rvm_run_with_env 'default.restore' 'system' 'rvm use system --default' 'Removing default ruby interpreter'
|
907
904
|
fi
|
@@ -912,15 +909,15 @@ __rvm_uninstall_ruby() {
|
|
912
909
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
913
910
|
|
914
911
|
if [[ -n "$rvm_ruby_string" ]] ; then
|
915
|
-
for dir in $rvm_rubies_path ; do
|
916
|
-
if [[ -d $dir/$rvm_ruby_string ]] ; then
|
917
|
-
$rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
|
912
|
+
for dir in "$rvm_rubies_path" ; do
|
913
|
+
if [[ -d "$dir/$rvm_ruby_string" ]] ; then
|
914
|
+
"$rvm_scripts_path/log" "info" "Removing $dir/$rvm_ruby_string..."
|
918
915
|
\rm -rf $dir/$rvm_ruby_string
|
919
916
|
else
|
920
|
-
$rvm_scripts_path/log "info" "$dir/$rvm_ruby_string has already been removed."
|
917
|
+
"$rvm_scripts_path/log" "info" "$dir/$rvm_ruby_string has already been removed."
|
921
918
|
fi
|
922
|
-
if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
|
923
|
-
\rm -f $rvm_bin_path/$rvm_ruby_string
|
919
|
+
if [[ -e "$rvm_bin_path/$rvm_ruby_string" ]] ; then
|
920
|
+
\rm -f "$rvm_bin_path/$rvm_ruby_string"
|
924
921
|
fi
|
925
922
|
done ; unset dir
|
926
923
|
|
@@ -931,7 +928,7 @@ __rvm_uninstall_ruby() {
|
|
931
928
|
__rvm_check_default
|
932
929
|
|
933
930
|
else
|
934
|
-
$rvm_scripts_path/log "fail" "Cannot uninstall unknown package '$rvm_ruby_string'"
|
931
|
+
"$rvm_scripts_path/log" "fail" "Cannot uninstall unknown package '$rvm_ruby_string'"
|
935
932
|
fi ; unset rvm_uninstall_flag
|
936
933
|
}
|
937
934
|
|
@@ -941,14 +938,14 @@ __rvm_remove_ruby() {
|
|
941
938
|
if [[ -n "$rvm_ruby_string" ]] ; then
|
942
939
|
for dir in $rvm_src_path $rvm_rubies_path ; do
|
943
940
|
if [[ -d $dir/$rvm_ruby_string ]] ; then
|
944
|
-
$rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
|
941
|
+
"$rvm_scripts_path/log" "info" "Removing $dir/$rvm_ruby_string..."
|
945
942
|
\rm -rf $dir/$rvm_ruby_string
|
946
943
|
else
|
947
|
-
$rvm_scripts_path/log "info" "it seems that $dir/$rvm_ruby_string is already non existent."
|
944
|
+
"$rvm_scripts_path/log" "info" "it seems that $dir/$rvm_ruby_string is already non existent."
|
948
945
|
fi
|
949
946
|
|
950
|
-
if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
|
951
|
-
\rm -f $rvm_bin_path/$rvm_ruby_string
|
947
|
+
if [[ -e "$rvm_bin_path/$rvm_ruby_string" ]] ; then
|
948
|
+
\rm -f "$rvm_bin_path/$rvm_ruby_string"
|
952
949
|
fi
|
953
950
|
|
954
951
|
__rvm_check_default
|
@@ -962,13 +959,13 @@ __rvm_remove_ruby() {
|
|
962
959
|
__rvm_remove_environments
|
963
960
|
__rvm_remove_binaries
|
964
961
|
else
|
965
|
-
$rvm_scripts_path/log "fail" "Cannot remove unknown package '$rvm_ruby_string'"
|
962
|
+
"$rvm_scripts_path/log" "fail" "Cannot remove unknown package '$rvm_ruby_string'"
|
966
963
|
fi ; unset rvm_remove_flag
|
967
964
|
}
|
968
965
|
|
969
966
|
__rvm_remove_gemsets() {
|
970
967
|
if [[ -n "$rvm_gems_flag" ]] ; then
|
971
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string gemsets..."
|
968
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string gemsets..."
|
972
969
|
gemsets="$rvm_gems_path/$rvm_ruby_string $(\ls -d "${rvm_gems_path}"/* | awk '/'$rvm_ruby_string'@/')"
|
973
970
|
for gemset in $gemsets ; do
|
974
971
|
if [[ -d "$gemset" ]] ; then
|
@@ -979,7 +976,7 @@ __rvm_remove_gemsets() {
|
|
979
976
|
}
|
980
977
|
|
981
978
|
__rvm_remove_wrappers() {
|
982
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string wrappers..."
|
979
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string wrappers..."
|
983
980
|
wrappers="$rvm_wrappers_path/$rvm_ruby_string $(\ls -d "$rvm_wrappers_path"/* 2>/dev/null | awk '/'$rvm_ruby_string'@/')"
|
984
981
|
for wrapper in $wrappers ; do
|
985
982
|
\rm -rf "$wrapper"
|
@@ -987,7 +984,7 @@ __rvm_remove_wrappers() {
|
|
987
984
|
}
|
988
985
|
|
989
986
|
__rvm_remove_environments() {
|
990
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string environments..."
|
987
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string environments..."
|
991
988
|
environments="$rvm_environments_path/$rvm_ruby_string $(\ls -d "$rvm_environments_path"/* | awk '/'$rvm_ruby_string'@/')"
|
992
989
|
for environment in $environments ; do
|
993
990
|
\rm -rf "$environment"
|
@@ -995,27 +992,27 @@ __rvm_remove_environments() {
|
|
995
992
|
}
|
996
993
|
|
997
994
|
__rvm_remove_aliases() {
|
998
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string aliases..."
|
995
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string aliases..."
|
999
996
|
aliases=$(awk '/'$rvm_ruby_string'/' $rvm_config_path/alias | sed 's/=.*//')
|
1000
997
|
for alias_name in $aliases ; do
|
1001
998
|
# Remove from alias key-value store
|
1002
|
-
$rvm_scripts_path/alias delete "$alias_name" >/dev/null 2>&1
|
999
|
+
"$rvm_scripts_path/alias" delete "$alias_name" >/dev/null 2>&1
|
1003
1000
|
done ; unset alias_name aliases
|
1004
1001
|
}
|
1005
1002
|
|
1006
1003
|
__rvm_remove_archives() {
|
1007
1004
|
if [[ -n "$rvm_archive_flag" ]] ; then
|
1008
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string archives..."
|
1009
|
-
\rm -f $rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}
|
1005
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string archives..."
|
1006
|
+
\rm -f "$rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}"
|
1010
1007
|
fi
|
1011
1008
|
}
|
1012
1009
|
|
1013
1010
|
__rvm_remove_binaries() {
|
1014
|
-
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string binaries..."
|
1011
|
+
"$rvm_scripts_path/log" "info" "Removing $rvm_ruby_string binaries..."
|
1015
1012
|
# Iterate over all binaries and check for symlinked wrappers etc.
|
1016
1013
|
for binary_name in $(\ls "$rvm_bin_path"); do
|
1017
1014
|
full_binary_path="$rvm_bin_path/$binary_name"
|
1018
|
-
if [[ -L "$full_binary_path" ]] && $rvm_scripts_path/match "$(readlink "$full_binary_path")" "$rvm_ruby_string"; then
|
1015
|
+
if [[ -L "$full_binary_path" ]] && "$rvm_scripts_path/match" "$(readlink "$full_binary_path")" "$rvm_ruby_string"; then
|
1019
1016
|
\rm -f "$full_binary_path"
|
1020
1017
|
fi
|
1021
1018
|
unset full_binary_path
|
@@ -1025,7 +1022,7 @@ __rvm_remove_binaries() {
|
|
1025
1022
|
__rvm_post_install() {
|
1026
1023
|
if [[ "$rvm_ruby_interpreter" != "jruby" ]] ; then
|
1027
1024
|
binaries="${binaries:-"gem irb erb ri rdoc testrb rake"}"
|
1028
|
-
$rvm_scripts_path/log "info" "adjusting shebangs for $rvm_ruby_string ($binaries)."
|
1025
|
+
"$rvm_scripts_path/log" "info" "adjusting shebangs for $rvm_ruby_string ($binaries)."
|
1029
1026
|
for binary in $(echo $binaries) ; do
|
1030
1027
|
if [[ -e "$rvm_ruby_home/bin/$binary" ]] || [[ -e "$rvm_ruby_src_path/bin/$binary" ]] ; then
|
1031
1028
|
if [[ "$rvm_ruby_src_path" != "$rvm_ruby_home" ]] && [[ -f "$rvm_ruby_src_path/bin/$binary" ]] ; then
|
@@ -1047,11 +1044,11 @@ __rvm_post_install() {
|
|
1047
1044
|
__rvm_generate_default_docs
|
1048
1045
|
|
1049
1046
|
if [[ -n "$rvm_ruby_aliases" ]]; then
|
1050
|
-
$rvm_scripts_path/log "info" "Setting up aliases for $rvm_ruby_string"
|
1047
|
+
"$rvm_scripts_path/log" "info" "Setting up aliases for $rvm_ruby_string"
|
1051
1048
|
while read -r ruby_alias; do
|
1052
|
-
$rvm_scripts_path/log info "Aliasing $rvm_ruby_string to $ruby_alias"
|
1053
|
-
$rvm_scripts_path/alias delete "$ruby_alias" > /dev/null 2>&1
|
1054
|
-
$rvm_scripts_path/alias create "$ruby_alias" "$rvm_ruby_string" > /dev/null 2>&1
|
1049
|
+
"$rvm_scripts_path/log" info "Aliasing $rvm_ruby_string to $ruby_alias"
|
1050
|
+
"$rvm_scripts_path/alias" delete "$ruby_alias" > /dev/null 2>&1
|
1051
|
+
"$rvm_scripts_path/alias" create "$ruby_alias" "$rvm_ruby_string" > /dev/null 2>&1
|
1055
1052
|
done < <(echo "$rvm_ruby_string" | \tr ' ' '\n' | sort -u)
|
1056
1053
|
unset rvm_ruby_aliases ruby_alias
|
1057
1054
|
fi
|
@@ -1064,7 +1061,7 @@ __rvm_generate_default_docs() {
|
|
1064
1061
|
}
|
1065
1062
|
|
1066
1063
|
__rvm_rubygems_setup() {
|
1067
|
-
if [[ -n "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] || [[ -n "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
|
1064
|
+
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" ]] || [[ -n "$(echo "$rvm_ruby_interpreter" | awk '/^mput/')" ]] ; then
|
1068
1065
|
install=0
|
1069
1066
|
elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
|
1070
1067
|
install=0
|
@@ -1079,7 +1076,7 @@ __rvm_rubygems_setup() {
|
|
1079
1076
|
__rvm_inject_ruby_shebang "$rvm_ruby_src_path/bin/gem"
|
1080
1077
|
__rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
|
1081
1078
|
|
1082
|
-
\cp $rvm_ruby_src_path/bin/gem $rvm_ruby_home/bin/gem
|
1079
|
+
\cp "$rvm_ruby_src_path/bin/gem" "$rvm_ruby_home/bin/gem"
|
1083
1080
|
|
1084
1081
|
home="$GEM_HOME" ; path="$GEM_PATH" # Save
|
1085
1082
|
for dir in $rvm_ruby_global_gems_path $rvm_ruby_gem_home ; do
|
@@ -1105,12 +1102,12 @@ __rvm_rubygems_setup() {
|
|
1105
1102
|
ruby_lib_gem_path="${directory_name}/${version_number}"
|
1106
1103
|
fi
|
1107
1104
|
unset directory_name version_number
|
1108
|
-
elif [[ -n "$(echo $rvm_ruby_interpreter | awk '/^rbx|jruby/')" ]] ; then
|
1105
|
+
elif [[ -n "$(echo "$rvm_ruby_interpreter" | awk '/^rbx|jruby/')" ]] ; then
|
1109
1106
|
# Hands off rubygems for rbx & jruby
|
1110
|
-
if [[ -n "$rvm_debug_flag" ]] ; then $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version" ; fi
|
1107
|
+
if [[ -n "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Skipping rubygems update for $rvm_ruby_version" ; fi
|
1111
1108
|
ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/jruby"
|
1112
1109
|
else
|
1113
|
-
$rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_string..."
|
1110
|
+
"$rvm_scripts_path/log" "info" "Installing rubygems dedicated to $rvm_ruby_string..."
|
1114
1111
|
rvm_rubygems_version="$(__rvm_db "${rvm_ruby_interpreter}_rubygems_version")"
|
1115
1112
|
rvm_rubygems_version="${rvm_rubygems_version:-"$(__rvm_db "rubygems_version")"}"
|
1116
1113
|
rvm_rubygems_url=$(__rvm_db "rubygems_${rvm_rubygems_version}_url")
|
@@ -1123,10 +1120,10 @@ __rvm_rubygems_setup() {
|
|
1123
1120
|
fi
|
1124
1121
|
|
1125
1122
|
if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
|
1126
|
-
$rvm_scripts_path/log "info" "Retrieving $rvm_gem_package_name"
|
1127
|
-
$rvm_scripts_path/fetch "$rvm_gem_url"
|
1123
|
+
"$rvm_scripts_path/log" "info" "Retrieving $rvm_gem_package_name"
|
1124
|
+
"$rvm_scripts_path/fetch" "$rvm_gem_url"
|
1128
1125
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
1129
|
-
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
1126
|
+
"$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
1130
1127
|
fi
|
1131
1128
|
\mkdir -p "$rvm_src_path/$rvm_gem_package_name"
|
1132
1129
|
__rvm_run "rubygems.extract" "gunzip < \"$rvm_archives_path/$rvm_gem_package_name.tgz\" | tar xf - -C $rvm_src_path" "Extracting $rvm_gem_package_name ..."
|
@@ -1137,9 +1134,9 @@ __rvm_rubygems_setup() {
|
|
1137
1134
|
__rvm_run "rubygems.install" "GEM_PATH=$rvm_ruby_gem_path GEM_HOME=$rvm_ruby_gem_home BUNDLE_PATH=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby"
|
1138
1135
|
result=$?
|
1139
1136
|
if [[ $result -eq 0 ]] ; then
|
1140
|
-
$rvm_scripts_path/log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
|
1137
|
+
"$rvm_scripts_path/log" "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
|
1141
1138
|
else
|
1142
|
-
$rvm_scripts_path/log "warning" "Installation of rubygems $rvm_ruby_package_name did not complete successfully."
|
1139
|
+
"$rvm_scripts_path/log" "warning" "Installation of rubygems $rvm_ruby_package_name did not complete successfully."
|
1143
1140
|
fi
|
1144
1141
|
|
1145
1142
|
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/gem"
|
@@ -1153,7 +1150,7 @@ __rvm_rubygems_setup() {
|
|
1153
1150
|
|
1154
1151
|
if [[ -n "$ruby_lib_gem_path" ]]; then
|
1155
1152
|
# Add ruby's gem path to ruby's lib direcotry.
|
1156
|
-
\mkdir -p $(dirname $ruby_lib_gem_path)
|
1153
|
+
\mkdir -p $(dirname "$ruby_lib_gem_path")
|
1157
1154
|
if [[ -d "$ruby_lib_gem_path" ]] ; then \rm -rf "$ruby_lib_gem_path" ; fi
|
1158
1155
|
ln -nfs "$rvm_ruby_gem_home" "$ruby_lib_gem_path"
|
1159
1156
|
fi; unset ruby_lib_gem_path
|
@@ -1205,8 +1202,8 @@ __rvm_actual_file() {
|
|
1205
1202
|
__rvm_manage_rubies() {
|
1206
1203
|
unset rvm_gemset_name rvm_ruby_selected_flag
|
1207
1204
|
|
1208
|
-
rvm_ruby_gem_home=$(echo $rvm_ruby_gem_home | awk -F${rvm_gemset_separator} '{print $1}')
|
1209
|
-
rvm_ruby_string=$(echo $rvm_ruby_string | awk -F${rvm_gemset_separator} '{print $1}')
|
1205
|
+
rvm_ruby_gem_home=$(echo "$rvm_ruby_gem_home" | awk -F${rvm_gemset_separator} '{print $1}')
|
1206
|
+
rvm_ruby_string=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $1}')
|
1210
1207
|
|
1211
1208
|
local manage_result=0
|
1212
1209
|
|
@@ -1239,9 +1236,9 @@ __rvm_manage_rubies() {
|
|
1239
1236
|
unset current_manage_ruby_string
|
1240
1237
|
__rvm_unset_ruby_variables
|
1241
1238
|
fi
|
1242
|
-
done < <(\ls $rvm_rubies_path/*/bin/ruby 2> /dev/null)
|
1239
|
+
done < <(\ls "$rvm_rubies_path"/*/bin/ruby 2> /dev/null)
|
1243
1240
|
else
|
1244
|
-
$rvm_scripts_path/log "warn" 'Really? '"$rvm_action"' all? See "rvm list known" and limit the selection to something more sane please :)'
|
1241
|
+
"$rvm_scripts_path/log" "warn" 'Really? '"$rvm_action"' all? See "rvm list known" and limit the selection to something more sane please :)'
|
1245
1242
|
fi
|
1246
1243
|
fi
|
1247
1244
|
|