rvm 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/VERSION.yml +1 -1
- data/lib/rvm/environment.rb +1 -1
- data/lib/rvm/shell/shell_wrapper.sh +1 -1
- data/rvm.gemspec +3 -110
- metadata +4 -111
- data/binscripts/rvm +0 -76
- data/binscripts/rvm-auto-ruby +0 -24
- data/binscripts/rvm-prompt +0 -208
- data/binscripts/rvm-shell +0 -35
- data/binscripts/rvm-update-head +0 -58
- data/binscripts/rvm-update-latest +0 -27
- data/binscripts/rvmsudo +0 -20
- data/config/db +0 -71
- data/config/known +0 -54
- data/config/md5 +0 -139
- data/contrib/gemset_snapshot +0 -25
- data/contrib/install-system-wide +0 -221
- data/contrib/r +0 -44
- data/examples/rvmrc +0 -49
- data/gemsets/default.gems +0 -1
- data/gemsets/global.gems +0 -1
- data/help/alias +0 -46
- data/help/benchmark +0 -17
- data/help/cleanup +0 -23
- data/help/debug +0 -8
- data/help/disk-usage +0 -15
- data/help/docs +0 -22
- data/help/exec +0 -33
- data/help/fetch +0 -5
- data/help/gem +0 -0
- data/help/gemdir +0 -0
- data/help/gemset +0 -14
- data/help/implode +0 -0
- data/help/info +0 -62
- data/help/install +0 -0
- data/help/list +0 -0
- data/help/migrate +0 -15
- data/help/monitor +0 -0
- data/help/notes +0 -0
- data/help/package +0 -0
- data/help/rake +0 -14
- data/help/remove +0 -0
- data/help/repair +0 -23
- data/help/reset +0 -0
- data/help/ruby +0 -84
- data/help/rubygems +0 -11
- data/help/rvmrc +0 -34
- data/help/snapshot +0 -15
- data/help/specs +0 -0
- data/help/srcdir +0 -0
- data/help/tests +0 -0
- data/help/tools +0 -22
- data/help/uninstall +0 -0
- data/help/update +0 -0
- data/help/upgrade +0 -18
- data/help/use +0 -0
- data/help/wrapper +0 -41
- data/install +0 -667
- data/man/man1/rvm.1 +0 -380
- data/man/man1/rvm.1.gz +0 -0
- data/scripts/alias +0 -226
- data/scripts/aliases +0 -4
- data/scripts/array +0 -32
- data/scripts/base +0 -57
- data/scripts/cd +0 -94
- data/scripts/cleanup +0 -58
- data/scripts/cli +0 -798
- data/scripts/color +0 -49
- data/scripts/completion +0 -151
- data/scripts/db +0 -87
- data/scripts/default +0 -64
- data/scripts/disk-usage +0 -60
- data/scripts/docs +0 -115
- data/scripts/env +0 -46
- data/scripts/environment-convertor +0 -74
- data/scripts/fetch +0 -231
- data/scripts/gemsets +0 -1045
- data/scripts/get +0 -126
- data/scripts/hash +0 -37
- data/scripts/help +0 -46
- data/scripts/hook +0 -23
- data/scripts/info +0 -213
- data/scripts/initialize +0 -29
- data/scripts/install +0 -667
- data/scripts/irbrc +0 -13
- data/scripts/irbrc.rb +0 -64
- data/scripts/list +0 -315
- data/scripts/log +0 -38
- data/scripts/maglev +0 -193
- data/scripts/manage +0 -2157
- data/scripts/match +0 -6
- data/scripts/md5 +0 -22
- data/scripts/migrate +0 -175
- data/scripts/monitor +0 -105
- data/scripts/notes +0 -140
- data/scripts/override_gem +0 -14
- data/scripts/package +0 -302
- data/scripts/patches +0 -64
- data/scripts/patchsets +0 -87
- data/scripts/repair +0 -199
- data/scripts/rubygems +0 -157
- data/scripts/rvm +0 -128
- data/scripts/rvm-install +0 -667
- data/scripts/selector +0 -904
- data/scripts/set +0 -301
- data/scripts/snapshot +0 -262
- data/scripts/tools +0 -58
- data/scripts/update +0 -667
- data/scripts/upgrade +0 -144
- data/scripts/utility +0 -1499
- data/scripts/version +0 -17
- data/scripts/wrapper +0 -210
data/scripts/rvm-install
DELETED
@@ -1,667 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -o errtrace
|
4
|
-
|
5
|
-
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
6
|
-
|
7
|
-
if [[ -z "$rvm_selfcontained" ]]; then
|
8
|
-
if [[ $(id -u) -eq 0 || -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
|
9
|
-
export rvm_selfcontained=0
|
10
|
-
else
|
11
|
-
export rvm_selfcontained=1
|
12
|
-
fi
|
13
|
-
fi
|
14
|
-
|
15
|
-
unset rvm_auto_flag
|
16
|
-
|
17
|
-
install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
|
18
|
-
|
19
|
-
if [[ -d "$install_source_path/scripts" \
|
20
|
-
&& -s "$install_source_path/scripts/utility" ]] ; then
|
21
|
-
builtin cd "$install_source_path"
|
22
|
-
fi
|
23
|
-
|
24
|
-
source scripts/version
|
25
|
-
source scripts/utility
|
26
|
-
|
27
|
-
usage()
|
28
|
-
{
|
29
|
-
printf "
|
30
|
-
Usage:
|
31
|
-
|
32
|
-
${0} [options]
|
33
|
-
|
34
|
-
options:
|
35
|
-
|
36
|
-
--auto : Automatically update shell profile files.
|
37
|
-
|
38
|
-
--prefix : Installation prefix directory.
|
39
|
-
|
40
|
-
--help : Display help/usage (this) message
|
41
|
-
|
42
|
-
--version : display rvm package version
|
43
|
-
|
44
|
-
\n"
|
45
|
-
}
|
46
|
-
|
47
|
-
check_rubyopt_conditions()
|
48
|
-
{
|
49
|
-
if [[ -n "${RUBYOPT:-""}" ]]; then
|
50
|
-
printf "
|
51
|
-
|
52
|
-
WARNING: You have RUBYOPT set in your current environment.
|
53
|
-
This may cause rubies to not work as you expect them to as it is not supported
|
54
|
-
by all of them If errors show up, please try unsetting RUBYOPT first.
|
55
|
-
|
56
|
-
"
|
57
|
-
fi
|
58
|
-
}
|
59
|
-
|
60
|
-
andand_return_instructions()
|
61
|
-
{
|
62
|
-
printf "
|
63
|
-
This means that if you see something like:
|
64
|
-
|
65
|
-
'[ -z \"\$PS1\" ] && return'
|
66
|
-
|
67
|
-
then you change this line to:
|
68
|
-
|
69
|
-
if [[ -n \"\$PS1\" ]] ; then
|
70
|
-
|
71
|
-
# ... original content that was below the '&& return' line ...
|
72
|
-
|
73
|
-
fi # <= be sure to close the if at the end of the .bashrc.
|
74
|
-
|
75
|
-
# This is a good place to source rvm v v v
|
76
|
-
[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\" # This loads RVM into a shell session.
|
77
|
-
|
78
|
-
EOF - This marks the end of the .bashrc file
|
79
|
-
"
|
80
|
-
}
|
81
|
-
|
82
|
-
installation_complete()
|
83
|
-
{
|
84
|
-
printf "
|
85
|
-
You must now complete the install by loading RVM in new shells.
|
86
|
-
|
87
|
-
1) Place the folowing line at the end of your shell's loading files
|
88
|
-
(.bashrc or .bash_profile for bash and .zshrc for zsh),
|
89
|
-
after all PATH/variable settings:
|
90
|
-
|
91
|
-
[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\" # This loads RVM into a shell session.
|
92
|
-
|
93
|
-
You only need to add this line the first time you install rvm.
|
94
|
-
|
95
|
-
2) Ensure that there is no 'return' from inside the ~/.bashrc file,
|
96
|
-
otherwise rvm may be prevented from working properly.
|
97
|
-
|
98
|
-
$(andand_return_instructions)
|
99
|
-
|
100
|
-
Be absolutely *sure* to REMOVE the '&& return'.
|
101
|
-
|
102
|
-
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
|
103
|
-
|
104
|
-
Placing all non-interactive (non login) items in the .bashrc,
|
105
|
-
including the 'source' line above and any environment settings.
|
106
|
-
|
107
|
-
3) CLOSE THIS SHELL and open a new one in order to use rvm.
|
108
|
-
\n"
|
109
|
-
}
|
110
|
-
|
111
|
-
andand_return_warning()
|
112
|
-
{
|
113
|
-
printf "
|
114
|
-
WARNING: you have a 'return' statement in your ~/.bashrc
|
115
|
-
This could cause some features of RVM to not work.
|
116
|
-
|
117
|
-
$(andand_return_instructions)
|
118
|
-
|
119
|
-
Even if you are using zsh you should still adjust the ~/.bashrc
|
120
|
-
If you have any questions about this please visit
|
121
|
-
#rvm on irc.freenode.net.
|
122
|
-
\n"
|
123
|
-
}
|
124
|
-
|
125
|
-
thank_you()
|
126
|
-
{
|
127
|
-
printf "
|
128
|
-
${name:-"${USER:-$(id | sed -e 's/^[^(]*(//' -e 's/).*$//')}"},
|
129
|
-
|
130
|
-
Thank you very much for using RVM! I sincerely hope that RVM helps to
|
131
|
-
make your work both easier and more enjoyable.
|
132
|
-
|
133
|
-
If you have any questions, issues and/or ideas for improvement please
|
134
|
-
join#rvm on irc.freenode.net and let me know, note you must register
|
135
|
-
(http://bit.ly/5mGjlm) and identify (/msg nickserv <nick> <pass>) to
|
136
|
-
talk, this prevents spambots from ruining our day.
|
137
|
-
|
138
|
-
My irc nickname is 'wayneeseguin' and I hang out in #rvm typically
|
139
|
-
|
140
|
-
~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT
|
141
|
-
|
142
|
-
If I do not respond right away, please hang around after asking your
|
143
|
-
question, I will respond as soon as I am back. It is best to talk in
|
144
|
-
#rvm itself as then other users can help out should I be offline.
|
145
|
-
|
146
|
-
Be sure to get head often as rvm development happens fast,
|
147
|
-
you can do this by running 'rvm get head' followed by 'rvm reload'
|
148
|
-
or opening a new shell
|
149
|
-
|
150
|
-
w⦿‿⦿t
|
151
|
-
|
152
|
-
~ Wayne
|
153
|
-
|
154
|
-
"
|
155
|
-
}
|
156
|
-
|
157
|
-
upgrade_notes()
|
158
|
-
{
|
159
|
-
printf "
|
160
|
-
|
161
|
-
Upgrade Notes
|
162
|
-
|
163
|
-
* rvm_trust_rvmrcs has been changed to rvm_trust_rvmrcs_flag for consistency
|
164
|
-
|
165
|
-
* Ruby package dependency list for your OS is given by:
|
166
|
-
rvm notes
|
167
|
-
|
168
|
-
* If you encounter any issues with a ruby 'X' your best bet is to:
|
169
|
-
rvm remove X ; rvm install X
|
170
|
-
|
171
|
-
* If you wish to have the 'pretty colors' again, set in ~/.rvmrc:
|
172
|
-
export rvm_pretty_print_flag=1
|
173
|
-
|
174
|
-
* If you see the following error message: Unknown alias name: 'default'
|
175
|
-
re-set your default ruby, this is due to a change in how default works.
|
176
|
-
"
|
177
|
-
}
|
178
|
-
|
179
|
-
set -o noclobber
|
180
|
-
set -o nounset
|
181
|
-
|
182
|
-
while [[ $# -gt 0 ]] ; do
|
183
|
-
token="$1" ; shift
|
184
|
-
case "$token" in
|
185
|
-
--auto) rvm_auto_flag=1 ;;
|
186
|
-
--prefix) rvm_prefix="$1" ; shift ;;
|
187
|
-
--version) rvm_path="$PWD" ; __rvm_version ; unset rvm_path ; exit ;;
|
188
|
-
--debug)
|
189
|
-
set -o verbose
|
190
|
-
;;
|
191
|
-
--trace)
|
192
|
-
echo "$*"
|
193
|
-
env | grep '^rvm_'
|
194
|
-
set -o xtrace
|
195
|
-
;;
|
196
|
-
--help)
|
197
|
-
usage
|
198
|
-
exit 0
|
199
|
-
;;
|
200
|
-
*)
|
201
|
-
echo "Unrecognized option: $token"
|
202
|
-
usage
|
203
|
-
exit 1
|
204
|
-
;;
|
205
|
-
esac
|
206
|
-
done
|
207
|
-
|
208
|
-
if [[ -z "${rvm_prefix:-""}" ]] ; then
|
209
|
-
|
210
|
-
if [[ "$USER" = "root" ]] ; then
|
211
|
-
|
212
|
-
source /etc/rvmrc
|
213
|
-
|
214
|
-
if [[ ${rvm_selfcontained:-0} -eq 0 ]] ; then
|
215
|
-
rvm_prefix="${rvm_prefix:-"/usr/local/"}"
|
216
|
-
else
|
217
|
-
rvm_prefix="${rvm_prefix:-"$HOME/."}"
|
218
|
-
fi
|
219
|
-
|
220
|
-
else
|
221
|
-
|
222
|
-
rvm_prefix="${rvm_prefix:-"$HOME/."}"
|
223
|
-
|
224
|
-
fi
|
225
|
-
|
226
|
-
fi
|
227
|
-
|
228
|
-
if [[ -z "${rvm_path:-""}" ]] ; then
|
229
|
-
rvm_path="${rvm_prefix}rvm"
|
230
|
-
fi
|
231
|
-
|
232
|
-
source scripts/initialize
|
233
|
-
|
234
|
-
if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null \
|
235
|
-
|| grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null ; then
|
236
|
-
|
237
|
-
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
238
|
-
|
239
|
-
export upgrade_flag=1
|
240
|
-
|
241
|
-
else
|
242
|
-
|
243
|
-
export upgrade_flag=0
|
244
|
-
|
245
|
-
fi
|
246
|
-
|
247
|
-
else
|
248
|
-
|
249
|
-
export upgrade_flag=0
|
250
|
-
|
251
|
-
fi
|
252
|
-
|
253
|
-
__rvm_initialize
|
254
|
-
|
255
|
-
#
|
256
|
-
# Setup & Configuration
|
257
|
-
#
|
258
|
-
item="* "
|
259
|
-
question="\n<?>"
|
260
|
-
cwd="$PWD"
|
261
|
-
|
262
|
-
source_path="${source_path:-$cwd}"
|
263
|
-
|
264
|
-
if [[ "$rvm_selfcontained" = "0" ]] ; then
|
265
|
-
rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
|
266
|
-
rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}"
|
267
|
-
rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
|
268
|
-
else
|
269
|
-
rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
|
270
|
-
rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
|
271
|
-
rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
|
272
|
-
fi
|
273
|
-
|
274
|
-
rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
|
275
|
-
rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
276
|
-
|
277
|
-
printf "
|
278
|
-
RVM: Shell scripts enabling management of multiple ruby environments.
|
279
|
-
RTFM: http://rvm.beginrescueend.com/
|
280
|
-
HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
|
281
|
-
"
|
282
|
-
|
283
|
-
if [[ ${upgrade_flag:-0} -eq 1 ]] ;then
|
284
|
-
|
285
|
-
printf "\nUpgrading the RVM installation in $rvm_path/"
|
286
|
-
|
287
|
-
else
|
288
|
-
|
289
|
-
printf "\nInstalling RVM to $rvm_path/"
|
290
|
-
|
291
|
-
fi
|
292
|
-
|
293
|
-
directories=(
|
294
|
-
"${rvm_archives_path:-"$rvm_path/archives"}"
|
295
|
-
"${rvm_src_path:-"$rvm_path/src"}"
|
296
|
-
"${rvm_log_path:-"$rvm_path/log"}"
|
297
|
-
"$rvm_bin_path"
|
298
|
-
"${rvm_gems_path:-"$rvm_path/gems"}"
|
299
|
-
"${rvm_rubies_path:-"$rvm_path/rubies"}"
|
300
|
-
"$rvm_path/config"
|
301
|
-
"${rvm_tmp_path:-"$rvm_path/tmp"}"
|
302
|
-
"$rvm_path/bin"
|
303
|
-
)
|
304
|
-
|
305
|
-
for directory in "${directories[@]}" ; do
|
306
|
-
|
307
|
-
if [[ ! -d "$directory" ]] ; then
|
308
|
-
|
309
|
-
mkdir -p "$directory"
|
310
|
-
|
311
|
-
fi
|
312
|
-
|
313
|
-
done
|
314
|
-
|
315
|
-
files=(README LICENCE)
|
316
|
-
|
317
|
-
for file in "${files[@]}"; do
|
318
|
-
|
319
|
-
cp -f "$source_path/$file" "$rvm_path/"
|
320
|
-
|
321
|
-
done
|
322
|
-
|
323
|
-
#
|
324
|
-
# Scripts
|
325
|
-
#
|
326
|
-
for dir_name in config scripts examples lib hooks help patches; do
|
327
|
-
|
328
|
-
if [[ -d "$source_path/$dir_name" ]] ; then
|
329
|
-
|
330
|
-
if [[ ! -d "$rvm_path/$dir_name" ]] ; then
|
331
|
-
|
332
|
-
mkdir -p "$rvm_path/$dir_name"
|
333
|
-
|
334
|
-
fi
|
335
|
-
|
336
|
-
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
337
|
-
|
338
|
-
fi
|
339
|
-
|
340
|
-
done
|
341
|
-
|
342
|
-
if [[ ! -s "$rvm_path/config/user" ]] ; then
|
343
|
-
echo '# User settings, overrides db settings and persists across installs.' \
|
344
|
-
>> "$rvm_path/config/user"
|
345
|
-
fi
|
346
|
-
|
347
|
-
scripts=(monitor match log install color db fetch log set package)
|
348
|
-
|
349
|
-
for script_name in "${scripts[@]}" ; do
|
350
|
-
|
351
|
-
chmod +x "$rvm_path/scripts/$script_name" 2>/dev/null # Hide errors.
|
352
|
-
|
353
|
-
done
|
354
|
-
|
355
|
-
#
|
356
|
-
# Bin Scripts
|
357
|
-
#
|
358
|
-
# Cleanse and purge...
|
359
|
-
files=(rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby)
|
360
|
-
|
361
|
-
for file in "${files[@]}" ; do
|
362
|
-
|
363
|
-
rm -f "$rvm_bin_path/$file"
|
364
|
-
|
365
|
-
cp -f "$source_path/binscripts/$file" "${rvm_bin_path:-"$rvm_path/bin"}/"
|
366
|
-
|
367
|
-
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
368
|
-
|
369
|
-
done
|
370
|
-
|
371
|
-
#
|
372
|
-
# RC Files
|
373
|
-
#
|
374
|
-
if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
|
375
|
-
|
376
|
-
printf "Checking rc files... ($rvm_rc_files)"
|
377
|
-
|
378
|
-
if [[ ${rvm_loaded_flag:-0} -ne 1 ]] ; then
|
379
|
-
|
380
|
-
for rcfile in $(printf $rvm_rc_files) ; do
|
381
|
-
|
382
|
-
if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
|
383
|
-
|
384
|
-
if [[ -s "$HOME/.profile" ]] ; then
|
385
|
-
|
386
|
-
if ! grep -q '.profile' "$rcfile" ; then
|
387
|
-
|
388
|
-
echo " Adding profile sourcing line to $rcfile."
|
389
|
-
|
390
|
-
printf "
|
391
|
-
# rvm install added line:
|
392
|
-
[[ -s \"$rvm_path/.profile\" ]] && source \"$rvm_path/.profile\"
|
393
|
-
" >> "$rcfile"
|
394
|
-
|
395
|
-
fi
|
396
|
-
|
397
|
-
fi
|
398
|
-
|
399
|
-
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
400
|
-
|
401
|
-
echo " Adding rvm loading line to $rcfile."
|
402
|
-
|
403
|
-
printf "
|
404
|
-
# rvm install added:
|
405
|
-
[[ -s \"$rvm_path/.rvm/scripts/rvm\" ]] && . \"$rvm_path/.rvm/scripts/rvm\"
|
406
|
-
" >> "$rcfile"
|
407
|
-
|
408
|
-
fi
|
409
|
-
|
410
|
-
done
|
411
|
-
fi
|
412
|
-
fi
|
413
|
-
|
414
|
-
#
|
415
|
-
# Initial Interpreter Gemsets.
|
416
|
-
#
|
417
|
-
if [[ -d gemsets/ ]] ; then
|
418
|
-
|
419
|
-
if [[ ! -d "$rvm_path/gemsets" ]] ; then
|
420
|
-
|
421
|
-
mkdir -p "$rvm_path/gemsets"
|
422
|
-
|
423
|
-
fi
|
424
|
-
|
425
|
-
for gemset_file in $(find "$PWD/gemsets" -iname '*.gems' | sed 's/^\.\///') ; do
|
426
|
-
|
427
|
-
cwd="${PWD//\//\\/}\/gemsets\/"
|
428
|
-
|
429
|
-
destination="$rvm_path/gemsets/${gemset_file/$cwd}"
|
430
|
-
|
431
|
-
destination_path="$(dirname "$destination")"
|
432
|
-
|
433
|
-
if [[ ! -s "$destination" ]] ; then
|
434
|
-
|
435
|
-
mkdir -p "$destination_path"
|
436
|
-
|
437
|
-
cp "$gemset_file" "$destination"
|
438
|
-
|
439
|
-
fi
|
440
|
-
|
441
|
-
done
|
442
|
-
|
443
|
-
fi
|
444
|
-
|
445
|
-
if [[ -d patchsets/ ]] ; then
|
446
|
-
|
447
|
-
if [[ ! -d "$rvm_path/patchsets" ]] ; then
|
448
|
-
|
449
|
-
mkdir -p "$rvm_path/patchsets"
|
450
|
-
|
451
|
-
fi
|
452
|
-
|
453
|
-
patchsets=($(builtin cd patchsets ; find \. -iname '*' | sed 's/^\.\///'))
|
454
|
-
|
455
|
-
for patchset_file in "${patchsets[@]}" ; do
|
456
|
-
|
457
|
-
destination="$rvm_path/patchsets/$patchset_file"
|
458
|
-
|
459
|
-
if [[ ! -s "$destination" ]] ; then
|
460
|
-
|
461
|
-
destination_path="$(dirname "$destination")"
|
462
|
-
|
463
|
-
mkdir -p "$destination_path"
|
464
|
-
|
465
|
-
cp "patchsets/$patchset_file" "$destination"
|
466
|
-
|
467
|
-
fi
|
468
|
-
done
|
469
|
-
|
470
|
-
fi
|
471
|
-
|
472
|
-
#
|
473
|
-
# Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
|
474
|
-
#
|
475
|
-
mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
476
|
-
|
477
|
-
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/goruby\
|
478
|
-
$rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
|
479
|
-
|
480
|
-
if [[ -d "$ruby" ]] ; then
|
481
|
-
|
482
|
-
mv "$ruby" "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
483
|
-
|
484
|
-
new_path="${rvm_rubies_path:-"$rvm_path/rubies"}/$(basename $ruby)"
|
485
|
-
|
486
|
-
for file in gem rake ; do
|
487
|
-
|
488
|
-
if [[ -s "$new_path/bin/$file" ]] ; then
|
489
|
-
|
490
|
-
sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" \
|
491
|
-
> "${new_path}/bin/${file}.new"
|
492
|
-
|
493
|
-
mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
|
494
|
-
|
495
|
-
chmod +x "$new_path/bin/$file"
|
496
|
-
|
497
|
-
fi
|
498
|
-
|
499
|
-
done
|
500
|
-
|
501
|
-
fi
|
502
|
-
|
503
|
-
done
|
504
|
-
#
|
505
|
-
# End of rubies migration.
|
506
|
-
#
|
507
|
-
|
508
|
-
if [[ -d "$rvm_path/environments" ]] ; then
|
509
|
-
#
|
510
|
-
# Remove BUNDLE_PATH from environment files
|
511
|
-
#
|
512
|
-
environments=($( find "$rvm_path/environments" -maxdepth 1 -mindepth 1 -type f ))
|
513
|
-
for file in "${environments[@]}" ; do
|
514
|
-
if grep 'BUNDLE_PATH' "$file" > /dev/null ; then
|
515
|
-
grep -v 'BUNDLE_PATH' "$file" > "$file.new"
|
516
|
-
mv "$file.new" "$file"
|
517
|
-
fi
|
518
|
-
done
|
519
|
-
fi
|
520
|
-
#
|
521
|
-
# Migrate old gemset directories to new gemset pattern.
|
522
|
-
#
|
523
|
-
for gemset in "$rvm_path"/gems/*\%* ; do
|
524
|
-
|
525
|
-
new_path=${gemset/\%/${rvm_gemset_separator:-"@"}}
|
526
|
-
|
527
|
-
if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
|
528
|
-
|
529
|
-
printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
530
|
-
|
531
|
-
mv "$gemset" "$new_path"
|
532
|
-
|
533
|
-
fi
|
534
|
-
|
535
|
-
done
|
536
|
-
|
537
|
-
for gemset in "$rvm_path"/gems/*\+* ; do
|
538
|
-
|
539
|
-
new_path=${gemset/\+/${rvm_gemset_separator:-"@"}}
|
540
|
-
|
541
|
-
if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
|
542
|
-
|
543
|
-
printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
544
|
-
|
545
|
-
mv $gemset $new_path
|
546
|
-
|
547
|
-
fi
|
548
|
-
|
549
|
-
done
|
550
|
-
|
551
|
-
for gemset in "$rvm_path"/gems/*\@ ; do
|
552
|
-
|
553
|
-
new_path=$(echo $gemset | sed -e 's#\@$##')
|
554
|
-
|
555
|
-
if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
|
556
|
-
|
557
|
-
printf "\n Fixing: $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
558
|
-
|
559
|
-
mv "$gemset" "$new_path"
|
560
|
-
|
561
|
-
fi
|
562
|
-
|
563
|
-
done
|
564
|
-
|
565
|
-
# Move from legacy defaults to the new, alias based system.
|
566
|
-
if [[ -s "$rvm_path/config/default" ]]; then
|
567
|
-
|
568
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
|
569
|
-
| awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
|
570
|
-
|
571
|
-
if [[ -n "$original_version" ]]; then
|
572
|
-
|
573
|
-
"$rvm_path/scripts/alias" create default "$original_version" &> /dev/null
|
574
|
-
|
575
|
-
fi ; unset original_version
|
576
|
-
|
577
|
-
rm -rf "$rvm_path/config/default"
|
578
|
-
|
579
|
-
fi
|
580
|
-
|
581
|
-
#
|
582
|
-
# End of gemset migration.
|
583
|
-
#
|
584
|
-
declare -a files
|
585
|
-
|
586
|
-
printf "\n Correct permissions for base binaries in $rvm_bin_path..."
|
587
|
-
|
588
|
-
mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
|
589
|
-
|
590
|
-
files=(rvm rvmsudo rvm-shell rvm-auto-ruby)
|
591
|
-
for file in "${files[@]}" ; do
|
592
|
-
|
593
|
-
if [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
|
594
|
-
|
595
|
-
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
596
|
-
|
597
|
-
fi
|
598
|
-
|
599
|
-
done
|
600
|
-
|
601
|
-
printf "\n Copying manpages into place.\n"
|
602
|
-
|
603
|
-
files=($(builtin cd "$install_source_path/man" ; \
|
604
|
-
find . -maxdepth 1 -mindepth 1 -type f -print))
|
605
|
-
|
606
|
-
for file in "${files[@]//.\/}" ; do
|
607
|
-
|
608
|
-
rm -rf "$rvm_man_path/$file"
|
609
|
-
|
610
|
-
cp -R "$install_source_path/man/$file" "$rvm_man_path/"
|
611
|
-
|
612
|
-
done
|
613
|
-
|
614
|
-
files=($( find "$rvm_path/" -mindepth 1 -maxdepth 2 -iname '*.swp' -type f ))
|
615
|
-
|
616
|
-
if [[ ${#files[@]} -gt 0 ]] ; then
|
617
|
-
|
618
|
-
printf "\n Cleanup any .swp files."
|
619
|
-
|
620
|
-
for file in "${files[@]}" ; do
|
621
|
-
|
622
|
-
if [[ -f "$file" ]] ; then
|
623
|
-
rm -f "$file"
|
624
|
-
fi
|
625
|
-
|
626
|
-
done
|
627
|
-
fi
|
628
|
-
|
629
|
-
if [[ $upgrade_flag -eq 0 ]] ; then
|
630
|
-
chmod +x ./scripts/notes # Sometimes things don't clone properly :/
|
631
|
-
./scripts/notes
|
632
|
-
fi
|
633
|
-
|
634
|
-
if command -v git > /dev/null 2>&1 ; then
|
635
|
-
name="$(git config user.name 2>/dev/null)"
|
636
|
-
fi
|
637
|
-
|
638
|
-
if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
|
639
|
-
|
640
|
-
upgrade_notes
|
641
|
-
|
642
|
-
check_rubyopt_conditions
|
643
|
-
|
644
|
-
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
|
645
|
-
|
646
|
-
else
|
647
|
-
|
648
|
-
if [[ ${rvm_selfcontained:-0} -eq 1 ]] ; then
|
649
|
-
|
650
|
-
installation_complete
|
651
|
-
|
652
|
-
fi
|
653
|
-
|
654
|
-
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
655
|
-
|
656
|
-
andand_return_warning
|
657
|
-
|
658
|
-
fi
|
659
|
-
|
660
|
-
check_rubyopt_conditions
|
661
|
-
|
662
|
-
printf "\nInstallation of RVM to $rvm_path/ is complete.\n\n"
|
663
|
-
fi
|
664
|
-
|
665
|
-
thank_you
|
666
|
-
|
667
|
-
exit 0
|