rvm 0.1.39 → 0.1.40

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,6 @@
1
1
  #!/usr/bin/env bash
2
-
3
- source $rvm_scripts_path/initialize
4
-
5
- if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
6
-
7
- trap "if [[ -d $rvm_tmp_path/ ]] && [[ -s $rvm_tmp_path/$$ ]] ; then rm -f $rvm_tmp_path/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
2
+ rvm_base_except="selector"
3
+ source "$rvm_scripts_path/base"
8
4
 
9
5
  rvm_help_path="${rvm_help_path:-"$rvm_path/help"}"
10
6
 
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- source $rvm_scripts_path/initialize
4
- source $rvm_scripts_path/utility
5
- source $rvm_scripts_path/selector
6
- source $rvm_scripts_path/version
3
+ source "$rvm_scripts_path/base"
4
+ source "$rvm_scripts_path/version"
7
5
 
8
- if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
9
6
  rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
10
7
 
11
8
  if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then rvm_ruby_gem_home="$(gem env home)" ; fi
@@ -45,8 +42,8 @@ info_ruby() {
45
42
 
46
43
  info_homes() {
47
44
  rvm_info="$rvm_info\n homes:"
48
- rvm_info="$rvm_info\n gem: \"${GEM_HOME:-'not set'}\""
49
- rvm_info="$rvm_info\n ruby: \"${MY_RUBY_HOME:-'not set'}\""
45
+ rvm_info="$rvm_info\n gem: \"${GEM_HOME:-"not set"}\""
46
+ rvm_info="$rvm_info\n ruby: \"${MY_RUBY_HOME:-"not set"}\""
50
47
  rvm_info="$rvm_info\n"
51
48
  }
52
49
 
@@ -23,6 +23,13 @@ usage() {
23
23
  "
24
24
  }
25
25
 
26
+ check_rubyopt_conditions() {
27
+ if [[ -n "$RUBYOPT" ]]; then
28
+ printf "\n\nWARNING: You have RUBYOPT set in your current environment. This may interfere with normal rvm"
29
+ printf "\n operation. If errors show up, please try unsetting RUBYOPT first.\n"
30
+ fi
31
+ }
32
+
26
33
  spinner_counter=0
27
34
  spinner() {
28
35
  array=('/' '-' '\\' '|' '/' '-' '\\' '|')
@@ -282,12 +289,14 @@ if [[ "$upgrade_flag" -eq 1 ]] ; then
282
289
  printf "\n * 1.8.7 default patchlevel is p174, override ~/.rvm/config/db in ~/.rvm/config/user"
283
290
  printf "\n * Gemset separator is '@' and will remain unless any rubies error using it."
284
291
  printf "\n$(tput sgr0)\n"
292
+ check_rubyopt_conditions
285
293
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
286
294
  else
287
295
  if [[ "root" != "$(whoami)" ]] ; then
288
296
  printf "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
289
297
  printf "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
290
298
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
299
+ printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
291
300
  printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
292
301
  printf "\n This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:"
293
302
  printf "\n if [[ ! -z "$PS1" ]] ; then"
@@ -309,6 +318,7 @@ else
309
318
  printf "\nEven if you use zsh you should still adjust the .bashrc as above."
310
319
  printf "\nIf you have any questions about this please visit #rvm on irc.freenode.net.\n"
311
320
  fi
321
+ check_rubyopt_conditions
312
322
  printf "\nInstallation of RVM to $rvm_path/ is complete.\n\n"
313
323
  fi
314
324
 
@@ -8,6 +8,47 @@ list_strings() {
8
8
  echo $(\ls $rvm_rubies_path)
9
9
  }
10
10
 
11
+ list_gemsets() {
12
+ echo
13
+ ruby=$(command -v ruby) ; current_ruby=""
14
+ if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo $ruby | awk '/rvm/')" ]] ; then
15
+ current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
16
+ fi
17
+
18
+ printf "rvm gemsets\n"
19
+ for version in $(\ls $rvm_gems_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
20
+ ruby_version_name="$(echo "$version" | awk -F"$rvm_gemset_separator" '{print $1}')"
21
+ if [[ -n "$(echo $version | awk '/^jruby-/')" ]] ; then
22
+ string="[ $($rvm_rubies_path/$ruby_version_name/bin/ruby -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
23
+ elif [[ -n "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
24
+ string="[ x86_64 ]"
25
+ else
26
+ string="[ $(file $rvm_rubies_path/$ruby_version_name/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
27
+ fi
28
+ unset ruby_version_name
29
+ printf "\n"
30
+ if [[ "$version" = "$current_ruby" ]]; then
31
+ printf "=> "
32
+ else
33
+ printf " "
34
+ fi
35
+ printf "$(tput setaf 2)$version$(tput sgr0) $string"
36
+ done ; unset version
37
+
38
+ if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
39
+ version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename)
40
+ if [[ ! -z "$version" ]] ; then
41
+ printf "\n\nDefault Ruby (for new shells)\n"
42
+ string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
43
+ printf "\n $(tput setaf 2)$version$(tput sgr0) $string"
44
+ fi ; unset version
45
+ fi
46
+ printf "\n"
47
+
48
+ unset current_ruby version selected system_ruby system_version string binary
49
+ echo
50
+ }
51
+
11
52
  list_default() {
12
53
  strings="$(echo $rvm_ruby_args | awk '{print $2}')"
13
54
  if [[ "$strings" = "string" ]] ; then
@@ -51,7 +92,7 @@ list_rubies() {
51
92
  printf "rvm rubies\n"
52
93
  for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
53
94
  if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
54
- string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
95
+ string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
55
96
  elif [[ ! -z "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
56
97
  string="[ x86_64 ]"
57
98
  else
@@ -87,6 +128,8 @@ action="$(echo "$1" | awk '{print $1}')"
87
128
 
88
129
  if [[ "known" = "$action" ]] ; then
89
130
  list_known
131
+ elif [[ "gemsets" = "$action" ]] ; then
132
+ list_gemsets
90
133
  elif [[ "default" = "$action" ]] ; then
91
134
  list_default
92
135
  elif [[ -z "$action" ]] || [[ "rubies" = "$action" ]] ; then
@@ -96,7 +139,7 @@ elif [[ "strings" = "$action" ]] ; then
96
139
  elif [[ "ruby_svn_tags" = "$action" ]] ; then
97
140
  list_ruby_svn_tags
98
141
  else # help
99
- printf "\nUsage: rvm list {known,default,rubies,strings}"
142
+ printf "\nUsage: rvm list {known,gemsets,default,rubies,strings}"
100
143
  fi
101
144
 
102
145
  exit $?
@@ -3,13 +3,7 @@
3
3
  original_ruby_version=$rvm_ruby_version
4
4
  original_ruby_string=$rvm_ruby_string
5
5
 
6
- source $rvm_scripts_path/initialize
7
- source $rvm_scripts_path/utility
8
- source $rvm_scripts_path/selector
9
-
10
- trap "rm -rf ${rvm_tmp_path}/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15
11
-
12
- if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
6
+ source "$rvm_scripts_path/base"
13
7
 
14
8
  # Checks for bison, returns zero iff it is found
15
9
  __rvm_check_for_bison() {
@@ -258,13 +252,11 @@ RubyWrapper
258
252
 
259
253
  rbx|rubinius)
260
254
  $rvm_scripts_path/log "info" "Installing pre-requisites"
261
- # prereqs, 1.8.6+ + rake. Yes this could all be one line... not pushing our luck.
262
- original_string="$rvm_ruby_string"
263
- export rvm_install_on_use_flag=1 ; $rvm_bin_path/rvm 1.8.7 --install # This should install if missing.
255
+
256
+ # Ensure we have a 1.8.7 compatible ruby installed.
257
+ __rvm_ensure_has_18_compat_ruby || return 1
264
258
  # TODO: use 'rvm gems load' here:
265
259
  unset CFLAGS LDFLAGS ARCHFLAGS # Important.
266
- __rvm_unset_ruby_variables ; rvm_ruby_string="$original_string" ; __rvm_select
267
- unset original_string
268
260
 
269
261
  unset BUNDLE_PATH GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
270
262
  PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
@@ -296,7 +288,7 @@ RubyWrapper
296
288
 
297
289
  __rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags"
298
290
 
299
- export ruby="$rvm_bin_path/ruby-1.8.7-p$(__rvm_db "ruby_1.8.7_patch_level")"
291
+ export ruby="$rvm_bin_path/$(__rvm_18_compat_ruby)"
300
292
 
301
293
  rvm_ruby_configure_flags="${rvm_ruby_configure_flags:-"--skip-system"}"
302
294
  rvm_ruby_configure="$ruby configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags" ; message="Configuring rbx"
@@ -325,12 +317,18 @@ RubyWrapper
325
317
  unset ruby
326
318
 
327
319
  # Symlink rubinius wrappers
328
- ln -fs "$rvm_ruby_home/bin/rbx" "$rvm_ruby_home/bin/irb"
329
320
  ln -fs "$rvm_ruby_home/bin/rbx" "$rvm_ruby_home/bin/ruby"
330
- # Install a wrapper around gem.
321
+
322
+ # Install IRB Wrapper on Rubinius.
323
+ file_name="$rvm_ruby_home/bin/irb"
324
+ rm -f "$file_name"
325
+ printf '#!/usr/bin/env bash\n' > "$file_name"
326
+ printf "exec '$rvm_ruby_home/bin/rbx' 'irb' \"\$@\"\n" >> "$file_name"
327
+ [[ -f "$file_name" ]] && chmod +x "$file_name"
328
+
329
+ # Install Gem Wrapper on Rubinius.
331
330
  file_name="$rvm_ruby_home/bin/gem"
332
331
  cp -f "$rvm_ruby_home/lib/bin/gem.rb" "$file_name"
333
-
334
332
  __rvm_inject_ruby_shebang "$file_name"
335
333
  [[ -f "$file_name" ]] && chmod +x "$file_name"
336
334
  unset file_name
@@ -399,7 +397,7 @@ RubyWrapper
399
397
  ;;
400
398
 
401
399
  maglev)
402
- export rvm_install_on_use_flag=1 ; $rvm_bin_path/rvm 1.8.7 --install # This should install if missing.
400
+ __rvm_ensure_has_18_compat_ruby
403
401
 
404
402
  $rvm_scripts_path/log "info" "Running MagLev prereqs checking script."
405
403
  $rvm_scripts_path/maglev
@@ -469,17 +467,21 @@ RubyWrapper
469
467
  fi
470
468
 
471
469
  #ln -fs "$rvm_ruby_home/$(echo $rvm_gemstone_package_file | awk -F'.' '{print $1}')" "$rvm_ruby_home/gemstone"
470
+
471
+ compatible_ruby="$(__rvm_18_compat_ruby)"
472
472
 
473
473
  if [[ ! -e ${rvm_ruby_home}/etc/conf.d/maglev.conf ]] ; then
474
474
  $rvm_scripts_path/log "info" "Creating default 'maglev' repository."
475
- $rvm_bin_path/rvm 1.8.7 rake "stone:create[maglev]" >/dev/null 2>&1
475
+ $rvm_bin_path/rvm "$(compatible_ruby)" rake "stone:create[maglev]" >/dev/null 2>&1
476
476
  fi
477
477
 
478
478
  $rvm_scripts_path/log "info" "Generating maglev HTML documentation"
479
- $rvm_bin_path/rvm 1.8.7 rake rdoc >/dev/null 2>&1
479
+ $rvm_bin_path/rvm "$(compatible_ruby)" rake rdoc >/dev/null 2>&1
480
480
 
481
481
  $rvm_scripts_path/log "info" "Generating smalltalk FFI."
482
- $rvm_bin_path/rvm 1.8.7 rake stwrappers >/dev/null 2>&1
482
+ $rvm_bin_path/rvm "$(compatible_ruby)" rake stwrappers >/dev/null 2>&1
483
+
484
+ unset compatible_ruby
483
485
 
484
486
  # TODO: Figure out if anything needs to be done with rubygems.
485
487
  #__rvm_rubygems_setup
@@ -508,15 +510,20 @@ RubyWrapper
508
510
  return 1
509
511
  fi
510
512
 
513
+ __rvm_ensure_has_18_compat_ruby
514
+
511
515
  __rvm_fetch_ruby
512
516
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
513
517
  builtin cd $rvm_ruby_src_path
514
518
 
515
- $rvm_bin_path/rvm 1.8.7 -S gem install pathname2 --no-rdoc --no-ri
519
+ compatible_ruby="$(__rvm_18_compat_ruby)"
520
+
521
+ $rvm_bin_path/rvm "$(compatible_ruby)" -S gem install pathname2 --no-rdoc --no-ri
516
522
 
517
523
  # MONO_LIB=/Library/Frameworks/Mono.framework/Versions/current/lib/
518
- rvm_ruby_make="$rvm_bin_path/rvm 1.8.7 -S rake MERLIN_ROOT=\"$rvm_ruby_src_path/Merlin/Main\" compile mono=1 configuration=release --trace"
524
+ rvm_ruby_make="$rvm_bin_path/rvm $(compatible_ruby) -S rake MERLIN_ROOT=\"$rvm_ruby_src_path/Merlin/Main\" compile mono=1 configuration=release --trace"
519
525
  __rvm_run "rake" "$rvm_ruby_make" "Building IronRuby..."
526
+ unset compatible_ruby
520
527
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
521
528
 
522
529
  rm -rf $rvm_ruby_home/*
@@ -834,15 +841,16 @@ __rvm_remove_ruby() {
834
841
  __rvm_remove_aliases
835
842
  __rvm_remove_wrappers
836
843
  __rvm_remove_environments
844
+ __rvm_remove_binaries
837
845
  else
838
846
  $rvm_scripts_path/log "fail" "Cannot remove unknown package '$rvm_ruby_string'"
839
847
  fi ; unset rvm_remove_flag
840
848
  }
841
849
 
842
850
  __rvm_remove_gemsets() {
843
- $rvm_scripts_path/log "info" "Removing $rvm_ruby_string gemsets..."
844
851
  if [[ ! -z "$rvm_gems_flag" ]] ; then
845
- gemsets="$rvm_gems_path/$rvm_ruby_string $(ls -d "${rvm_gems_path}"/* | awk '/'$rvm_ruby_string'@/')"
852
+ $rvm_scripts_path/log "info" "Removing $rvm_ruby_string gemsets..."
853
+ gemsets="$rvm_gems_path/$rvm_ruby_string $(\ls -d "${rvm_gems_path}"/* | awk '/'$rvm_ruby_string'@/')"
846
854
  for gemset in $gemsets ; do
847
855
  if [[ -d "$gemset" ]] ; then
848
856
  rm -rf "$gemset"
@@ -853,36 +861,48 @@ __rvm_remove_gemsets() {
853
861
 
854
862
  __rvm_remove_wrappers() {
855
863
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string wrappers..."
856
- wrappers="$rvm_wrappers_path/$rvm_ruby_string $(ls -d "$rvm_wrappers_path"/* | awk '/'$rvm_ruby_string'@/')"
864
+ wrappers="$rvm_wrappers_path/$rvm_ruby_string $(\ls -d "$rvm_wrappers_path"/* 2>/dev/null | awk '/'$rvm_ruby_string'@/')"
857
865
  for wrapper in $wrappers ; do
858
866
  rm -rf "$wrapper"
859
867
  done ; unset wrapper wrappers
860
868
  }
869
+
861
870
  __rvm_remove_environments() {
862
871
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string environments..."
863
- environments="$rvm_environments_path/$rvm_ruby_string $(ls -d "$rvm_environments_path"/* | awk '/'$rvm_ruby_string'@/')"
872
+ environments="$rvm_environments_path/$rvm_ruby_string $(\ls -d "$rvm_environments_path"/* | awk '/'$rvm_ruby_string'@/')"
864
873
  for environment in $environments ; do
865
874
  rm -rf "$environment"
866
875
  done ; unset environment environments
867
876
  }
877
+
868
878
  __rvm_remove_aliases() {
869
879
  $rvm_scripts_path/log "info" "Removing $rvm_ruby_string aliases..."
870
- aliases=$(awk '/'$rvm_ruby_string'/' $rvm_config_path/alias)
880
+ aliases=$(awk '/'$rvm_ruby_string'/' $rvm_config_path/alias | sed 's/=.*//')
871
881
  for alias_name in $aliases ; do
872
882
  # Remove from alias key-value store
873
- $rvm_scripts_path/db $rvm_config_path/alias $alias_name delete
874
- # Remove the place holding symlink
875
- rm -f $rvm_rubies_path/$alias_name
883
+ $rvm_scripts_path/alias delete "$alias_name" >/dev/null 2>&1
876
884
  done ; unset alias_name aliases
877
885
  }
878
886
 
879
887
  __rvm_remove_archives() {
880
- $rvm_scripts_path/log "info" "Removing $rvm_ruby_string archives..."
881
888
  if [[ ! -z "$rvm_archive_flag" ]] ; then
889
+ $rvm_scripts_path/log "info" "Removing $rvm_ruby_string archives..."
882
890
  rm -f $rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}
883
891
  fi
884
892
  }
885
893
 
894
+ __rvm_remove_binaries() {
895
+ $rvm_scripts_path/log "info" "Removing $rvm_ruby_string binaries..."
896
+ # Iterate over all binaries and check for symlinked wrappers etc.
897
+ for binary_name in $(\ls "$rvm_bin_path"); do
898
+ full_binary_path="$rvm_bin_path/$binary_name"
899
+ if [[ -L "$full_binary_path" ]] && $rvm_scripts_path/match "$(readlink "$full_binary_path")" "$rvm_ruby_string"; then
900
+ rm -f "$full_binary_path"
901
+ fi
902
+ unset full_binary_path
903
+ done; unset binary_name
904
+ }
905
+
886
906
  __rvm_post_install() {
887
907
  if [[ "$rvm_ruby_interpreter" != "jruby" ]] ; then
888
908
  binaries="${binaries:-"gem irb erb ri rdoc testrb rake"}"
@@ -952,7 +972,20 @@ __rvm_rubygems_setup() {
952
972
 
953
973
  __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/gem"
954
974
  __rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
955
- ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/${rvm_release_version}.$rvm_major_version"
975
+
976
+ directory_name="$rvm_ruby_home/lib/ruby/gems"
977
+ version_number="${rvm_release_version}.${rvm_major_version}"
978
+ if [[ "$version_number" == "." ]]; then
979
+ version_number="$(\ls "$directory_name" | grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)"
980
+ if [[ -n "$version_number" ]]; then
981
+ ruby_lib_gem_path="${directory_name}/${version_number}"
982
+ else
983
+ ruby_lib_gem_path=""
984
+ fi
985
+ else
986
+ ruby_lib_gem_path="${directory_name}/${version_number}"
987
+ fi
988
+ unset directory_name version_number
956
989
  elif [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^rbx|jruby/')" ]] ; then
957
990
  # Hands off rubygems for rbx & jruby
958
991
  if [[ ! -z "$rvm_debug_flag" ]] ; then $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version" ; fi
@@ -964,7 +997,6 @@ __rvm_rubygems_setup() {
964
997
  rvm_rubygems_url=$(__rvm_db "rubygems_${rvm_rubygems_version}_url")
965
998
  rvm_gem_package_name="rubygems-$rvm_rubygems_version"
966
999
  rvm_gem_url="$rvm_rubygems_url/$rvm_gem_package_name.tgz"
967
-
968
1000
  # Sanity check... If setup.rb is missing from the rubygems source path,
969
1001
  # something went wrong. Cleanup, aisle 3!
970
1002
  if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
@@ -1000,14 +1032,12 @@ __rvm_rubygems_setup() {
1000
1032
  fi
1001
1033
  fi
1002
1034
 
1003
- # Add ruby's gem path to ruby's lib direcotry.
1004
- mkdir -p $(dirname $ruby_lib_gem_path)
1005
-
1006
- if [[ -d "$ruby_lib_gem_path" ]] ; then rm -rf "$ruby_lib_gem_path" ; fi
1007
-
1008
- ln -nfs "$rvm_ruby_gem_home" "$ruby_lib_gem_path"
1009
-
1010
- unset ruby_lib_gem_path
1035
+ if [[ -n "$ruby_lib_gem_path" ]]; then
1036
+ # Add ruby's gem path to ruby's lib direcotry.
1037
+ mkdir -p $(dirname $ruby_lib_gem_path)
1038
+ if [[ -d "$ruby_lib_gem_path" ]] ; then rm -rf "$ruby_lib_gem_path" ; fi
1039
+ ln -nfs "$rvm_ruby_gem_home" "$ruby_lib_gem_path"
1040
+ fi; unset ruby_lib_gem_path
1011
1041
 
1012
1042
  if [[ -s "$rvm_ruby_src_path/bin/rdoc" ]] ; then
1013
1043
  __rvm_inject_ruby_shebang "$rvm_ruby_src_path/bin/rdoc"
@@ -1054,13 +1084,13 @@ __rvm_actual_file() {
1054
1084
  }
1055
1085
 
1056
1086
  __rvm_manage_rubies() {
1057
- rubies=() ; successes=() ; errors=() ; statuses=()
1058
-
1059
1087
  unset rvm_gemset_name rvm_ruby_selected_flag
1060
1088
 
1061
1089
  rvm_ruby_gem_home=$(echo $rvm_ruby_gem_home | awk -F${rvm_gemset_separator} '{print $1}')
1062
1090
  rvm_ruby_string=$(echo $rvm_ruby_string | awk -F${rvm_gemset_separator} '{print $1}')
1063
1091
 
1092
+ local manage_result=0
1093
+
1064
1094
  if [[ ! -z "$rubies_string" ]] ;then
1065
1095
  for rvm_ruby_string in $(echo $rubies_string | tr ',' ' ') ; do
1066
1096
  eval "__rvm_${rvm_action}_ruby"
@@ -1081,9 +1111,9 @@ __rvm_manage_rubies() {
1081
1111
  fi
1082
1112
  fi
1083
1113
 
1084
- if [[ ! -z "$rvm_summary_flag" ]] ; then __rvm_summary ; fi
1085
- if [[ ! -z "$rvm_yaml_flag" ]] ; then __rvm_yaml ; fi
1086
- if [[ ! -z "$rvm_json_flag" ]] ; then __rvm_json ; fi
1114
+ # TODO: This should return the exit status of the command that got called.
1115
+ return $manage_result
1116
+
1087
1117
  }
1088
1118
 
1089
1119
  rvm_action="$1" ; rubies_string="$2"
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi
4
-
5
3
  original_ruby_strings=$rvm_ruby_strings
6
4
  original_ruby_string=$rvm_ruby_string
7
5
 
8
- source $rvm_scripts_path/rvm
6
+ source "$rvm_scripts_path/base"
9
7
 
10
8
  rvm_monitor_sleep="${rvm_monitor_sleep:-2}"
11
9
 
12
- trap "rm -f $rvm_tmp_path/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15
13
-
14
10
  timestamp() {
15
11
  if [[ "Darwin" = "$(uname)" ]] ; then
16
12
  echo $(stat -f "%m" $1)
@@ -46,7 +46,7 @@ if [[ "Linux" = "$system" ]] ; then
46
46
 
47
47
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
48
48
  printf "\n $item For MRI/ree (if you wish to use it) you will need:"
49
- printf "\n $ yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel"
49
+ printf "\n $ yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel"
50
50
  printf "\n $ yum install -y iconv-devel # NOTE: For centos 5.4 final iconv-devel might not be available :("
51
51
 
52
52
  printf "\n $item For JRuby (if you wish to use it) you will need:"
@@ -1,26 +1,8 @@
1
1
  #!/usr/bin/env bash
2
+ rvm_base_except="selector"
3
+ source "$rvm_scripts_path/base"
2
4
 
3
- #
4
- # ruby dependency packages:
5
- #
6
-
7
- for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
8
- if [[ -f "$rvmrc" ]] ; then
9
- if grep -q '^\s*rvm .*$' $rvmrc ; then
10
- $rvm_scripts_path/log "error" "$rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
11
- return 1
12
- else
13
- source "$rvmrc"
14
- fi
15
- fi
16
- done
17
-
18
- source $rvm_scripts_path/initialize
19
- source $rvm_scripts_path/utility
20
- __rvm_load_rvmrc
21
-
22
- trap "rm -f $rvm_tmp_path/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15
23
- if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
5
+ # Tools to make managing ruby dependencies inside of rvm easier.
24
6
 
25
7
  action="$(echo "$*" | awk '{print $1}')"
26
8
  library="$(echo "$*" | awk '{print $2}')"
@@ -28,6 +10,8 @@ args=$(echo "$*" | awk '{$1="" ; $2="" ; print}' | sed -e 's/^[[:space:]]*//' -e
28
10
 
29
11
  install_package() {
30
12
 
13
+ __rvm_db "${package}_url" "package_url"
14
+
31
15
  if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
32
16
 
33
17
  __rvm_pushpop $rvm_src_path
@@ -60,13 +44,14 @@ install_package() {
60
44
  __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_usr_path"
61
45
  fi
62
46
 
63
- __rvm_pushpop
47
+ touch "$rvm_config_path/packages"
48
+ $rvm_scripts_path/db "$rvm_config_path/packages" "${package}" "${version}"
64
49
 
50
+ __rvm_pushpop
65
51
  }
66
52
 
67
53
  readline() {
68
54
  package="readline" ; archive_format="tar.gz"
69
- package_url="ftp://ftp.gnu.org/gnu/readline"
70
55
  for version in 5.2 6.0 ; do
71
56
  configure_flags="--disable-dependency-tracking --disable-static --enable-shared"
72
57
  install_package
@@ -75,19 +60,16 @@ readline() {
75
60
 
76
61
  iconv() {
77
62
  package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
78
- package_url="http://ftp.gnu.org/pub/gnu/libiconv"
79
63
  install_package
80
64
  }
81
65
 
82
66
  curl() {
83
67
  package="curl" ; version=7.19.7 ; archive_format="tar.gz"
84
- package_url="http://curl.haxx.se/download"
85
68
  install_package
86
69
  }
87
70
 
88
71
  openssl() {
89
72
  package="openssl" ; version="0.9.8n" ; archive_format="tar.gz"
90
- package_url="http://www.openssl.org/source"
91
73
  if [[ "Darwin" = "$(uname)" ]] ; then
92
74
  if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then
93
75
  export openssl_os="os/compiler darwin64-x86_64-cc"
@@ -106,39 +88,32 @@ openssl() {
106
88
 
107
89
  zlib() {
108
90
  package="zlib" ; version="1.2.5" ; archive_format="tar.gz"
109
- package_url="http://www.zlib.net"
110
91
  install_package
111
92
  }
112
93
 
113
94
  autoconf() {
114
- package_url="ftp.gnu.org/gnu/autoconf"
115
95
  package="autoconf" ; version="2.65" ; archive_format="tar.gz"
116
-
117
96
  prefix_path="${rvm_bin_path:-"${rvm_path:-"$HOME/.rvm"}"}"
118
97
  install_package
119
98
  }
120
99
 
121
100
  ncurses() {
122
- package_url="http://ftp.gnu.org/pub/gnu/ncurses"
123
101
  package="ncurses" ; version="5.7" ; archive_format="tar.gz"
124
102
  configure_flags="--with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs"
125
103
  install_package
126
104
  }
127
105
 
128
106
  pkgconfig() {
129
- package_url="http://pkgconfig.freedesktop.org/releases"
130
107
  package="pkg-config" ; version="0.23" archive_format="tar.gz"
131
108
  install_package
132
109
  }
133
110
 
134
111
  gettext() {
135
- package_url="ftp://ftp.gnu.org/pub/gnu/gettext"
136
112
  package="gettext" ; version="0.17" ; archive_format="tar.gz"
137
113
  install_package
138
114
  }
139
115
 
140
116
  libxml2() {
141
- package_url="ftp://xmlsoft.org/libxml2/"
142
117
  package="libxml2" ; version="2.7.3" ; archive_format="tar.gz"
143
118
  if [[ "Darwin" = "$(uname)" ]] ; then
144
119
  configure="./configure --prefix=${rvm_usr_path} --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
@@ -149,7 +124,6 @@ libxml2() {
149
124
 
150
125
  glib() {
151
126
  package="glib" ; version="2.23.1" ; archive_format="tar.gz"
152
- package_url="http://ftp.gnome.org/pub/gnome/sources/glib/2.23"
153
127
  configure="CC=\"cc -L$rvm_usr_path/lib\" ./configure --prefix=$rvm_usr_path"
154
128
 
155
129
  install_package
@@ -162,17 +136,17 @@ mono() {
162
136
 
163
137
  __rvm_mono_env
164
138
  package="mono" ; version="2.6.1" ; archive_format="tar.bz2"
165
- packge_url="http://ftp.novell.com/pub/mono/sources/mono/"
166
-
167
139
  install_package
168
140
  }
169
141
 
170
142
  llvm() {
143
+ package="llvm" ; version="89156"
171
144
  if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
172
145
  __rvm_pushpop $rvm_src_path
173
146
  if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
147
+ __rvm_db "${package}_url" "package_url"
174
148
  rm -rf "$rvm_src_path/llvm"
175
- svn co -r 89156 https://llvm.org/svn/llvm-project/llvm/trunk llvm
149
+ svn co -r "$version" "$package_url" llvm
176
150
  builtin cd "$rvm_src_path/llvm"
177
151
  ./configure --enable-bindings=none
178
152
  UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make -j2