Permalink
Browse files

Bugfix: rvm install X for libraries now works again, broken in 0.0.89

  • Loading branch information...
1 parent 1aacc77 commit 146ff69c2b213f2597fcc71524b080d9e2daaed0 @wayneeseguin wayneeseguin committed Dec 8, 2009
Showing with 38 additions and 30 deletions.
  1. +2 −1 scripts/cli
  2. +6 −10 scripts/gems
  3. +23 −18 scripts/libraries
  4. +7 −1 scripts/utility
View
@@ -69,6 +69,7 @@ __rvm_parse_args() {
gemdir)
rvm_action=$rvm_token
+ rvm_gemdir_flag=1
if [[ "system" = "$1" ]] ; then export rvm_system_flag=1 ; shift ; fi
if [[ "user" = "$1" ]] ; then export rvm_user_flag=1 ; shift ; fi
;;
@@ -361,7 +362,7 @@ rvm() {
result=0
case "$rvm_action" in
use) __rvm_use ; result=$? ;;
- gemdir) __rvm_gemdir ; result=$? ;;
+ gemdir) $rvm_scripts_path/gems gemdir ; result=$? ;;
srcdir) __rvm_source_dir ; result=$? ;;
list) __rvm_list ; result=$? ;;
version) __rvm_version ; result=$? ;;
View
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
-source $rvm_path/scripts/initialize
-source $rvm_path/scripts/utility
-source $rvm_path/scripts/selector
+source $rvm_path/scripts/rvm
+#source $rvm_path/scripts/utility
+#source $rvm_path/scripts/selector
if [[ "$rvm_trace_flag" -eq 1 ]] ; then set -x ; export rvm_trace_flag ; fi
@@ -22,12 +22,6 @@ __rvm_gems_list() {
done
}
-__rvm_gems_clear() {
- unset rvm_ruby_gem_home rvm_gem_set_name GEM_HOME GEM_PATH
- __rvm_gems_select
- __rvm_gems_use
-}
-
__rvm_gems_delete() {
if [[ ! -z "$rvm_gem_set_name" ]] ; then
gemdir="$rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version%$rvm_gem_set_name"
@@ -217,7 +211,7 @@ __rvm_gem_install() {
unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string
}
-__rvm_gemdir() {
+__rvm_gems_gemdir() {
if [[ "$rvm_user_flag" -eq 1 ]] ; then
echo $(rvm system ; gem env | grep "\- $HOME" | awk '{print $NF}')
@@ -255,6 +249,8 @@ elif [[ "$rvm_dir_flag" -eq 1 ]] ; then
__rvm_gems_dir
elif [[ "$rvm_list_flag" -eq 1 ]] ; then
__rvm_gems_list
+elif [[ "$rvm_gemdir_flag" -eq 1 ]] ; then
+ __rvm_gems_gemdir
elif [[ "$rvm_install_flag" -eq 1 ]] ; then
__rvm_gem_install
else
View
@@ -25,12 +25,13 @@ __rvm_readline_install() {
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package"
fi
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
+
done
__rvm_pushpop
}
@@ -45,12 +46,13 @@ __rvm_iconv_install() {
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
builtin cd "$rvm_src_path/$package-$version"
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
+
__rvm_pushpop
}
@@ -64,12 +66,13 @@ __rvm_curl_install() {
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
builtin cd "$rvm_src_path/$package-$version"
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
+
__rvm_pushpop
}
@@ -88,12 +91,13 @@ __rvm_openssl_install() {
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
builtin cd "$rvm_src_path/$package-$version"
__rvm_run "$package/config" "./config --prefix=$rvm_path/usr zlib no-asm no-krb5 shared" "Configuring $package."
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
+
__rvm_pushpop
}
@@ -107,12 +111,13 @@ __rvm_zlib_install() {
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
builtin cd "$rvm_src_path/$package-$version"
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
+
__rvm_pushpop
}
@@ -126,11 +131,11 @@ __rvm_ncurses_install() {
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package.$archive_format -C $rvm_src_path" "Extracting $package.$archive_format"
builtin cd "$rvm_src_path/$package-$version"
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" "Configuring $package."
- if [[ "$rvm_install_flag" -eq 1 ]] ; then
+ if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
+ __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
+ else
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
- elif [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr"
fi
__rvm_pushpop
}
View
@@ -131,7 +131,7 @@ __rvm_run() {
__rvm_cleanup_variables() {
__rvm_unset_ruby_variables
- unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags
+ unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag
}
__rvm_unset_ruby_variables() {
@@ -687,3 +687,9 @@ __rvm_gems_use() {
__rvm_use
}
+__rvm_gems_clear() {
+ unset rvm_ruby_gem_home rvm_gem_set_name GEM_HOME GEM_PATH
+ __rvm_gems_select
+ __rvm_gems_use
+}
+

0 comments on commit 146ff69

Please sign in to comment.