rvm 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/scripts/notes CHANGED
@@ -3,14 +3,6 @@
3
3
  system="$(uname)"
4
4
  item="$(tput setaf 2)* $(tput sgr0)"
5
5
 
6
- echo -e "\n$(tput setaf 6)**** NOTICE *************************************************************************************"
7
- echo -e "* The rubies install path has moved to \$rvm_path/rubies/ instead of directly in \$rvm_path. *"
8
- echo -e "* If you encounter any issues with a ruby your best bet is to 'rvm remove X ; rvm install X' *"
9
- echo -e "* Gems are now per interpreter installation instead of per interpreter/version *"
10
- echo -e "* so for example to upgrade an older install of 1.8.6 and preserve gems: *"
11
- echo -e "* rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383 *"
12
- echo -e "*************************************************************************************************$(tput sgr0)\n"
13
-
14
6
  if [[ "Linux" = "$system" ]] ; then
15
7
  for file in /etc/*-release ; do
16
8
  release="( $(cat $file) )" ; break
data/scripts/package CHANGED
@@ -92,7 +92,8 @@ zlib() {
92
92
  }
93
93
 
94
94
  ncurses() {
95
- package_url="ftp://invisible-island.net/ncurses/ncurses"
95
+
96
+ package_url="http://ftp.gnu.org/pub/gnu/ncurses"
96
97
  package="ncurses" ; version="5.7" ; archive_format="tar.gz"
97
98
  configure_flags="--with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs"
98
99
  install_package
data/scripts/rvm-install CHANGED
@@ -13,9 +13,9 @@ source scripts/utility
13
13
  usage() {
14
14
  echo -e "
15
15
  Usage:
16
- ${0} <options>
16
+ ${0} [options]
17
17
 
18
- Options:
18
+ options:
19
19
  --auto : Automatically update shell profile files.
20
20
  --prefix : Installation prefix directory.
21
21
  --help : Display help/usage (this) message
@@ -23,6 +23,15 @@ usage() {
23
23
  "
24
24
  }
25
25
 
26
+ spinner_counter=0
27
+ spinner() {
28
+ array=('/' '-' '\\' '|' '/' '-' '\\' '|')
29
+ index=$((($spinner_counter % 8)))
30
+ echo -e -n "\r${array[$index]}"
31
+ let "spinner_counter=spinner_counter+1"
32
+ which perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
33
+ }
34
+
26
35
  if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
27
36
 
28
37
  while [[ $# -gt 0 ]] ; do
@@ -47,18 +56,25 @@ fi
47
56
  if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
48
57
 
49
58
  source scripts/initialize
59
+ if grep -q 'scripts/rvm' $HOME/.bash* || grep -q 'scripts/rvm' $HOME/.zsh*; then
60
+ if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
61
+ export upgrade_flag=1
62
+ else
63
+ export upgrade_flag=0
64
+ fi
65
+ else
66
+ export upgrade_flag=0
67
+ fi
68
+
50
69
  __rvm_initialize
51
70
 
52
71
  #
53
- # Setup
72
+ # Setup & Configuration
54
73
  #
55
74
  item="$(tput setaf 2)* $(tput sgr0)"
56
75
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
57
76
  cwd=$(pwd)
58
77
  source_path="${source_path:-$cwd}"
59
-
60
- # State what is required to use rvm
61
- echo -e "\nInstalling rvm to $rvm_path/ ..."
62
78
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
63
79
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
64
80
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
@@ -71,9 +87,25 @@ rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
71
87
  rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
72
88
  rvm_symlink_path="${rvm_symlink_path:-$rvm_prefix/bin}"
73
89
 
90
+ export rvm_gemset_separator="@" # TODO: Remove this after a while.
91
+
92
+ echo -e "\n$(tput setaf 2)RVM$(tput sgr0) - shell scripts which allow management of multiple ruby interpreters and environments."
93
+ echo -e "\n $(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
94
+ echo -e "\n $(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)"
95
+
96
+ echo -e "\n********************************************************************************"
97
+ if [[ "$upgrade_flag" -eq 1 ]] ;then
98
+ echo -e -n " Upgrading the RVM installation in $rvm_path/"
99
+ else
100
+ echo -e -n " Installing rvm to $rvm_path/"
101
+ fi
102
+
103
+ spinner
104
+
74
105
  mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path $HOME/.gem/cache
75
106
 
76
107
  for file in README LICENCE ; do
108
+ spinner
77
109
  cp -f "$source_path/$file" "$rvm_path/"
78
110
  done
79
111
 
@@ -81,19 +113,22 @@ done
81
113
  # Scripts
82
114
  #
83
115
  for dir_name in config scripts examples lib hooks ; do
116
+ spinner
84
117
  mkdir -p "$rvm_path/$dir_name"
85
118
  if [[ -d "$source_path/$dir_name" ]] ; then
86
119
  cp -Rf "$source_path/$dir_name" "$rvm_path"
87
120
  fi
88
121
  done ; unset dir_name
89
122
 
123
+ spinner
90
124
  if [[ ! -s "$rvm_config_path/user" ]] ; then
91
125
  mkdir -p "$rvm_config_path/"
92
126
  echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
93
127
  fi
94
128
 
95
- scripts="monitor match log install color db fetch log set package"
96
- for script_name in $(echo $scripts) ; do
129
+ scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
130
+ for script_name in $scripts ; do
131
+ spinner
97
132
  chmod +x $rvm_scripts_path/$script_name
98
133
  done
99
134
 
@@ -102,14 +137,17 @@ done
102
137
  #
103
138
  # Cleanse and purge...
104
139
  for file in rvm-prompt rvm rvmsudo ; do
140
+ spinner && perl -e 'sleep 0.2'
105
141
  rm -f "$rvm_bin_path/$file"
106
142
  cp -f "$source_path/binscripts/$file" $rvm_bin_path/
107
143
  done
144
+ spinner
108
145
  chmod +x $rvm_bin_path/*
109
146
 
110
147
  #
111
148
  # RC Files
112
149
  #
150
+ spinner
113
151
  if [[ ! -z "$rvm_auto_flag" ]] ; then
114
152
  echo -e "Checking rc files... ($rvm_rc_files)"
115
153
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
@@ -134,11 +172,13 @@ fi
134
172
  #
135
173
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
136
174
  mkdir -p "$rvm_rubies_path/"
175
+ spinner
137
176
  for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
138
177
  if [[ -d "$ruby" ]] ; then
139
178
  mv "$ruby" "$rvm_rubies_path/"
140
179
  new_path="$rvm_rubies_path/$(basename $ruby)"
141
180
  for file in gem rake ; do
181
+ spinner
142
182
  if [[ -s "$new_path/bin/$file" ]] ; then
143
183
  sed -i.orig -e '1,1s=.*=#!'"$new_path/bin/ruby=" "$new_path/bin/$file"
144
184
  rm -f "$new_path/bin/$file.orig"
@@ -148,7 +188,46 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
148
188
  fi
149
189
  done
150
190
  #
151
- # End of migration.
191
+ # End of rubies migration.
192
+ #
193
+
194
+ #
195
+ # Migrate old gemset directories to new gemset pattern.
196
+ #
197
+ spinner
198
+ echo -e -n "\r*" # Stop spinner.
199
+
200
+ for gemset in $rvm_path/gems/*\%* ; do
201
+ new_path=${gemset/\%/${rvm_gemset_separator}}
202
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
203
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
204
+ mv $gemset $new_path
205
+ fi
206
+ done
207
+
208
+ for gemset in $rvm_path/gems/*\+* ; do
209
+ new_path=${gemset/\+/${rvm_gemset_separator}}
210
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
211
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
212
+ mv $gemset $new_path
213
+ fi
214
+ done
215
+ for gemset in $rvm_path/gems/*\@ ; do
216
+ new_path=$(echo $gemset | sed -e 's#\@$##')
217
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
218
+ echo -e " Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator."
219
+ mv $gemset $new_path
220
+ fi
221
+ done
222
+
223
+ # Upgrade any default file.
224
+ if [[ -s $rvm_config_path/default ]] && grep -q '\%' $rvm_config_path/default ; then
225
+ sed -e "s#\%#${rvm_gemset_separator}#g" $rvm_config_path/default > $rvm_config_path/default.new
226
+ mv $rvm_config_path/default.new $rvm_config_path/default
227
+ fi
228
+
229
+ #
230
+ # End of gemset migration.
152
231
  #
153
232
 
154
233
  if [[ "root" = "$(whoami)" ]] ; then
@@ -160,11 +239,11 @@ if [[ "root" = "$(whoami)" ]] ; then
160
239
  chmod +x $rvm_symlink_path/rvmsudo
161
240
  fi
162
241
 
163
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
164
- ./scripts/notes
242
+ if [[ "$upgrade_flag" -eq 0 ]] ; then
243
+ echo -e "\n********************************************************************************"
244
+ ./scripts/notes
245
+ fi
165
246
 
166
- echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
167
- echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
168
247
  echo -e "\n********************************************************************************"
169
248
  name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
170
249
  echo -e "\n${name:-"$(whoami)"},\n"
@@ -177,20 +256,28 @@ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
177
256
  echo -e "\n ~ Wayne"
178
257
  echo -e "\n********************************************************************************"
179
258
 
180
- if [[ "root" != "$(whoami)" ]] ; then
181
- echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
182
- echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
183
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
184
- echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
185
- echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
186
- echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
187
- echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
188
- echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
189
- echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
190
- fi
191
-
192
- if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
193
- echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
259
+ if [[ "$upgrade_flag" -eq 1 ]] ; then
260
+ echo -e "\n$(tput setaf 6)**** NOTICE *************************************************************************************"
261
+ echo -e "* Gemset separator has changed, it is now @ and will remain unless any rubies error using it. *"
262
+ echo -e "* If you encounter any issues with a ruby your best bet is to 'rvm remove X ; rvm install X' *"
263
+ echo -e "*************************************************************************************************$(tput sgr0)\n"
264
+ echo -e "Upgrade of RVM in $rvm_path/ is complete.\n"
265
+ else
266
+ if [[ "root" != "$(whoami)" ]] ; then
267
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
268
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
269
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
270
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
271
+ echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
272
+ echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
273
+ echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
274
+ echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
275
+ echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
276
+ fi
277
+ if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
278
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n"
279
+ fi
280
+ echo -e "Installation of RVM to $rvm_path/ is complete.\n\n"
194
281
  fi
195
282
 
196
283
  exit 0
data/scripts/selector CHANGED
@@ -46,7 +46,7 @@ __rvm_select() {
46
46
  rvm_ruby_interpreter="rbx"
47
47
  rvm_ruby_version=${rvm_ruby_version:-$(__rvm_db "rbx_version")}
48
48
  rvm_ruby_repo_url=${rvm_rbx_repo_url:-$(__rvm_db "rubinius_repo_url")}
49
- __rvm_db "rbx_url" "rvm_url"
49
+ __rvm_db "rbx_${rvm_ruby_version}_${rvm_ruby_patch_level}_url" "rvm_url"
50
50
  if [[ -z "$rvm_head_flag" ]] ; then
51
51
  rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(__rvm_db "rbx_patch_level")}
52
52
  rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-p$rvm_ruby_patch_level"
@@ -210,7 +210,7 @@ __rvm_select() {
210
210
  fi
211
211
 
212
212
  if [[ ! -z "$rvm_gemset_name" ]] ; then
213
- rvm_ruby_gem_home="${rvm_ruby_gem_home}%${rvm_gemset_name}"
213
+ rvm_ruby_gem_home="${rvm_ruby_gem_home}${rvm_gemset_separator}${rvm_gemset_name}"
214
214
  fi
215
215
 
216
216
  rvm_ruby_selected_flag=1
@@ -295,7 +295,7 @@ __rvm_use() {
295
295
  fi
296
296
 
297
297
  if [[ ! -z "$rvm_verbose_flag" ]] ; then
298
- $rvm_scripts_path/log "info" "Using $(basename $GEM_HOME | tr '-' ' ' | sed 's/%/ with gemset /')"
298
+ $rvm_scripts_path/log "info" "Using $(basename $GEM_HOME | tr '-' ' ' | sed 's/'${rvm_gemset_separator}'/ with gemset /')"
299
299
  fi
300
300
 
301
301
  new_path="$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
@@ -367,9 +367,9 @@ __rvm_ruby_string() {
367
367
  # * rvm_ruby_tag
368
368
  # * rvm_ruby_patch
369
369
 
370
- set_name=$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')
370
+ set_name=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $2}')
371
371
  if [[ ! -z "$set_name" ]] ; then rvm_gemset_name="$set_name" ; fi
372
- ruby_string=$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')
372
+ ruby_string=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $1}')
373
373
 
374
374
  __rvm_unset_ruby_variables
375
375
 
data/scripts/update CHANGED
@@ -13,9 +13,9 @@ source scripts/utility
13
13
  usage() {
14
14
  echo -e "
15
15
  Usage:
16
- ${0} <options>
16
+ ${0} [options]
17
17
 
18
- Options:
18
+ options:
19
19
  --auto : Automatically update shell profile files.
20
20
  --prefix : Installation prefix directory.
21
21
  --help : Display help/usage (this) message
@@ -23,6 +23,15 @@ usage() {
23
23
  "
24
24
  }
25
25
 
26
+ spinner_counter=0
27
+ spinner() {
28
+ array=('/' '-' '\\' '|' '/' '-' '\\' '|')
29
+ index=$((($spinner_counter % 8)))
30
+ echo -e -n "\r${array[$index]}"
31
+ let "spinner_counter=spinner_counter+1"
32
+ which perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
33
+ }
34
+
26
35
  if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
27
36
 
28
37
  while [[ $# -gt 0 ]] ; do
@@ -47,18 +56,25 @@ fi
47
56
  if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
48
57
 
49
58
  source scripts/initialize
59
+ if grep -q 'scripts/rvm' $HOME/.bash* || grep -q 'scripts/rvm' $HOME/.zsh*; then
60
+ if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
61
+ export upgrade_flag=1
62
+ else
63
+ export upgrade_flag=0
64
+ fi
65
+ else
66
+ export upgrade_flag=0
67
+ fi
68
+
50
69
  __rvm_initialize
51
70
 
52
71
  #
53
- # Setup
72
+ # Setup & Configuration
54
73
  #
55
74
  item="$(tput setaf 2)* $(tput sgr0)"
56
75
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
57
76
  cwd=$(pwd)
58
77
  source_path="${source_path:-$cwd}"
59
-
60
- # State what is required to use rvm
61
- echo -e "\nInstalling rvm to $rvm_path/ ..."
62
78
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
63
79
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
64
80
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
@@ -71,9 +87,25 @@ rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
71
87
  rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
72
88
  rvm_symlink_path="${rvm_symlink_path:-$rvm_prefix/bin}"
73
89
 
90
+ export rvm_gemset_separator="@" # TODO: Remove this after a while.
91
+
92
+ echo -e "\n$(tput setaf 2)RVM$(tput sgr0) - shell scripts which allow management of multiple ruby interpreters and environments."
93
+ echo -e "\n $(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
94
+ echo -e "\n $(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)"
95
+
96
+ echo -e "\n********************************************************************************"
97
+ if [[ "$upgrade_flag" -eq 1 ]] ;then
98
+ echo -e -n " Upgrading the RVM installation in $rvm_path/"
99
+ else
100
+ echo -e -n " Installing rvm to $rvm_path/"
101
+ fi
102
+
103
+ spinner
104
+
74
105
  mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path $HOME/.gem/cache
75
106
 
76
107
  for file in README LICENCE ; do
108
+ spinner
77
109
  cp -f "$source_path/$file" "$rvm_path/"
78
110
  done
79
111
 
@@ -81,19 +113,22 @@ done
81
113
  # Scripts
82
114
  #
83
115
  for dir_name in config scripts examples lib hooks ; do
116
+ spinner
84
117
  mkdir -p "$rvm_path/$dir_name"
85
118
  if [[ -d "$source_path/$dir_name" ]] ; then
86
119
  cp -Rf "$source_path/$dir_name" "$rvm_path"
87
120
  fi
88
121
  done ; unset dir_name
89
122
 
123
+ spinner
90
124
  if [[ ! -s "$rvm_config_path/user" ]] ; then
91
125
  mkdir -p "$rvm_config_path/"
92
126
  echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
93
127
  fi
94
128
 
95
- scripts="monitor match log install color db fetch log set package"
96
- for script_name in $(echo $scripts) ; do
129
+ scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
130
+ for script_name in $scripts ; do
131
+ spinner
97
132
  chmod +x $rvm_scripts_path/$script_name
98
133
  done
99
134
 
@@ -102,14 +137,17 @@ done
102
137
  #
103
138
  # Cleanse and purge...
104
139
  for file in rvm-prompt rvm rvmsudo ; do
140
+ spinner && perl -e 'sleep 0.2'
105
141
  rm -f "$rvm_bin_path/$file"
106
142
  cp -f "$source_path/binscripts/$file" $rvm_bin_path/
107
143
  done
144
+ spinner
108
145
  chmod +x $rvm_bin_path/*
109
146
 
110
147
  #
111
148
  # RC Files
112
149
  #
150
+ spinner
113
151
  if [[ ! -z "$rvm_auto_flag" ]] ; then
114
152
  echo -e "Checking rc files... ($rvm_rc_files)"
115
153
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
@@ -134,11 +172,13 @@ fi
134
172
  #
135
173
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
136
174
  mkdir -p "$rvm_rubies_path/"
175
+ spinner
137
176
  for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
138
177
  if [[ -d "$ruby" ]] ; then
139
178
  mv "$ruby" "$rvm_rubies_path/"
140
179
  new_path="$rvm_rubies_path/$(basename $ruby)"
141
180
  for file in gem rake ; do
181
+ spinner
142
182
  if [[ -s "$new_path/bin/$file" ]] ; then
143
183
  sed -i.orig -e '1,1s=.*=#!'"$new_path/bin/ruby=" "$new_path/bin/$file"
144
184
  rm -f "$new_path/bin/$file.orig"
@@ -148,7 +188,46 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
148
188
  fi
149
189
  done
150
190
  #
151
- # End of migration.
191
+ # End of rubies migration.
192
+ #
193
+
194
+ #
195
+ # Migrate old gemset directories to new gemset pattern.
196
+ #
197
+ spinner
198
+ echo -e -n "\r*" # Stop spinner.
199
+
200
+ for gemset in $rvm_path/gems/*\%* ; do
201
+ new_path=${gemset/\%/${rvm_gemset_separator}}
202
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
203
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
204
+ mv $gemset $new_path
205
+ fi
206
+ done
207
+
208
+ for gemset in $rvm_path/gems/*\+* ; do
209
+ new_path=${gemset/\+/${rvm_gemset_separator}}
210
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
211
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
212
+ mv $gemset $new_path
213
+ fi
214
+ done
215
+ for gemset in $rvm_path/gems/*\@ ; do
216
+ new_path=$(echo $gemset | sed -e 's#\@$##')
217
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
218
+ echo -e " Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator."
219
+ mv $gemset $new_path
220
+ fi
221
+ done
222
+
223
+ # Upgrade any default file.
224
+ if [[ -s $rvm_config_path/default ]] && grep -q '\%' $rvm_config_path/default ; then
225
+ sed -e "s#\%#${rvm_gemset_separator}#g" $rvm_config_path/default > $rvm_config_path/default.new
226
+ mv $rvm_config_path/default.new $rvm_config_path/default
227
+ fi
228
+
229
+ #
230
+ # End of gemset migration.
152
231
  #
153
232
 
154
233
  if [[ "root" = "$(whoami)" ]] ; then
@@ -160,11 +239,11 @@ if [[ "root" = "$(whoami)" ]] ; then
160
239
  chmod +x $rvm_symlink_path/rvmsudo
161
240
  fi
162
241
 
163
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
164
- ./scripts/notes
242
+ if [[ "$upgrade_flag" -eq 0 ]] ; then
243
+ echo -e "\n********************************************************************************"
244
+ ./scripts/notes
245
+ fi
165
246
 
166
- echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
167
- echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
168
247
  echo -e "\n********************************************************************************"
169
248
  name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
170
249
  echo -e "\n${name:-"$(whoami)"},\n"
@@ -177,20 +256,28 @@ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
177
256
  echo -e "\n ~ Wayne"
178
257
  echo -e "\n********************************************************************************"
179
258
 
180
- if [[ "root" != "$(whoami)" ]] ; then
181
- echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
182
- echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
183
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
184
- echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
185
- echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
186
- echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
187
- echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
188
- echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
189
- echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
190
- fi
191
-
192
- if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
193
- echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
259
+ if [[ "$upgrade_flag" -eq 1 ]] ; then
260
+ echo -e "\n$(tput setaf 6)**** NOTICE *************************************************************************************"
261
+ echo -e "* Gemset separator has changed, it is now @ and will remain unless any rubies error using it. *"
262
+ echo -e "* If you encounter any issues with a ruby your best bet is to 'rvm remove X ; rvm install X' *"
263
+ echo -e "*************************************************************************************************$(tput sgr0)\n"
264
+ echo -e "Upgrade of RVM in $rvm_path/ is complete.\n"
265
+ else
266
+ if [[ "root" != "$(whoami)" ]] ; then
267
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
268
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
269
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
270
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
271
+ echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
272
+ echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
273
+ echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
274
+ echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
275
+ echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
276
+ fi
277
+ if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
278
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n"
279
+ fi
280
+ echo -e "Installation of RVM to $rvm_path/ is complete.\n\n"
194
281
  fi
195
282
 
196
283
  exit 0