bash/rvm in wayneeseguin-rvm-0.0.20 vs bash/rvm in wayneeseguin-rvm-0.0.22

- old
+ new

@@ -1,11 +1,11 @@ #!/bin/bash rvm_author="Wayne E. Seguin" rvm_author_email="wayneeseguin@gmail.com" rvm_website="http://rvm.beginrescueend.com/" -rvm_version="0.0.21" +rvm_version="0.0.22" rvm_updated="2009.08.25" # # License: See LICENSE # @@ -94,46 +94,21 @@ * rvm gemdup * root support * Settings file, user overridable * Show current in rvm list, if applicable - Many Thanks: - - Bash Support Testing - - - Daniel Neighman (dneighman@gmail.com) - irc: hassox ; github: http://github.com/hassox - - - John Mettraux (jmettraux@openwfe.org) - irc: jmettraux ; github: http://github.com/jmettraux - - ZSH Support Testing - - - Franco Lazzarino (flazzarino@gmail.com) - irc: flazz ; github: http://github.com/flazz - - Ubuntu Linux Support Testing - - - Anita Kuno (anteaya@anteaya.info) - irc: anteaya ; github: http://github.com/anteaya - - Website Design - - - Jim Lindley (jlindley@gmail.com) - irc: jlindley ; github: http://github.com/jlindley - Usage } # Logging functions based on level -function rvm-log { echo -e "\n $* \e[0m" ; } -function rvm-log-debug { rvm-log "\e[4;34m <d> \e[0m$*" ; } -function rvm-log-info { rvm-log "\e[0;32m <i> \e[0m$*" ; } -function rvm-log-warn { rvm-log "\e[0;33m <w> \e[0m$*" ; } -function rvm-log-error { rvm-log "\e[0;31m <e> \e[0m$*" ; } -function rvm-log-fail { rvm-log "\e[0;31m <e> \e[0m$*" ; return 1 ; } +function rvm-log { echo -e "\n $* \033[0m" ; } +function rvm-log-debug { rvm-log "\033[4;34m <d> \033[0m$*" ; } +function rvm-log-info { rvm-log "\033[0;32m <i> \033[0m$*" ; } +function rvm-log-warn { rvm-log "\033[0;33m <w> \033[0m$*" ; } +function rvm-log-error { rvm-log "\033[0;31m <e> \033[0m$*" ; } +function rvm-log-fail { rvm-log "\033[0;31m <e> \033[0m$*" ; return 1 ; } function rvm-gi { gem install -q --no-rdoc --no-ri $* ; } function rvm-info { @@ -188,17 +163,17 @@ rvm-log-info "\tExtracting $package_name..." tar xzf $package_name.tar.gz && cd $package_name fi rvm-log-info "\tConfiguring $package_name using ${configure-'--enable-shared'}, this may take a while depending on your cpu(s)..." - ./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} > $install_path/$package_name/configure.log 2> $install_path/$package_name/configure.error.log + ./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} > $install_path/log/$package_name/configure.log 2> $install_path/log/$package_name/configure.error.log rvm-log-info "\tCompiling $package_name, this may take a while, depending on your cpu(s)..." - make > $install_path/$package_name/make.log 2> $install_path/$package_name/make.error.log + make > $install_path/log/$package_name/make.log 2> $install_path/log/$package_name/make.error.log rvm-log-info "\tInstalling $package_name" - make install > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log + make install > $install_path/log/$package_name/install.log 2> $install_path/log/$package_name/install.error.log chmod +x $install_path/$package_name/bin/* # Create the ~/.rvm/bin/$package_name ln -fs $install_path/$package_name/bin/ruby $install_path/bin/$package_name @@ -212,17 +187,17 @@ if [ ! -f $gem_package_name.tgz ] ; then eval $curl $gem_url ; fi tar zxf $gem_package_name.tgz && cd $gem_package_name fi # Well this is fun... fix nil error on require_paths: sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb - $install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log + $install_path/$package_name/bin/ruby ./setup.rb > $install_path/log/$package_name/rubygems.install.log 2> $install_path/log/$package_name/rubygems.install.error.log popd > /dev/null rvm-log-info "Installation of $package_name complete." for gem_name in rake ; do rvm-log-info "Installing $gem_name" - $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log + $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log done } function rvm-install-ruby { @@ -248,11 +223,11 @@ tar xzf $package_name.tar.gz && cd $package_name fi rvm-log-info "\tInstalling $package_name, this may take a while, depending on your cpu(s)..." mkdir -p $install_path/$package_name - ./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log + ./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems > $install_path/log/$package_name/install.log 2> $install_path/log/$package_name/install.error.log chmod +x $install_path/$package_name/bin/* ln -fs $install_path/$package_name/bin/ruby $install_path/bin/$package_name rvm-log-info "\tInstalling rubygems dedicated to $package_name..." @@ -264,17 +239,17 @@ if [ ! -f $gem_package_name.tgz ] ; then eval $curl $gem_url ; fi tar zxf $gem_package_name.tgz && cd $gem_package_name fi # Well this is fun... fix nil error on require_paths: sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb - $install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log + $install_path/$package_name/bin/ruby ./setup.rb > $install_path/log/$package_name/rubygems.install.log 2> $install_path/log/$package_name/rubygems.install.error.log rvm-log-info "Installation of $package_name complete." popd > /dev/null for gem_name in rake ; do rvm-log-info "Installing $gem_name" - $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log + $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log done ;; jruby) version=${version-1.3.1} # 1.2.0, 1.3.1 @@ -298,22 +273,22 @@ fi rvm-log-info "\tInstalling $package_name..." mkdir -p $install_path/$package_name/bin/ rsync -ag $source_path/$package_name/ $install_path/$package_name/ - cd $source_path/$package_name/tool/nailgun && make > $install_path/$package_name/install.nailgun.log 2> $install_path/$package_name/install.error.nailgun.log + cd $source_path/$package_name/tool/nailgun && make > $install_path/log/$package_name/install.nailgun.log 2> $install_path/log/$package_name/install.error.nailgun.log popd > /dev/null chmod +x $install_path/$package_name/bin/* for binary in jruby jgem jirb ; do ln -fs $install_path/$package_name/bin/$binary $install_path/$package_name/bin/${binary#j} done ln -fs $install_path/$package_name/bin/ruby $install_path/bin/$package_name for gem_name in rake jruby-openssl ; do rvm-log-info "Installing $gem_name" - $install_path/$package_name/bin/jgem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log + $install_path/$package_name/bin/jgem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log done ;; ruby) rvm-install-source ${version-1.8.6} ${patchlevel-$3} @@ -475,11 +450,11 @@ eval value=\$${variable} echo "${variable}='$value' ; export ${variable}" >> $install_path/current done fi - rvm-log-info "Switching to $implementation $version $patchlevel ..." + rvm-log-info "Switching to $implementation $version $patchlevel ...\n" if [ ! -z "$BASH_VERSION" ] ; then exec bash -l elif [ ! -z "$ZSH_VERSION" ] ; then exec zsh -l else @@ -725,10 +700,12 @@ -c|--configure) configure="$1" ; shift ;; -d|--debug) debug=1 ;; *) rvm-usage ; return 1 esac done + + if [ "$debug" = "1" ] ; then set -x ; fi curl=`which curl` if [ $? -ne 0 ] ; then rvm-log-fail "rvm expects that curl is available, which curl shows no curl :(" else @@ -788,22 +765,21 @@ else default_system_ruby=`which ruby` echo $default_system_ruby > $install_path/default_system_ruby fi - if [ "$debug" = "1" ] ; then set -x ; fi - case "$action" in install) if [ "$implementation" = "all" ] ; then for implementation in ruby jruby ree ; do if [ "$implementation" = "ruby" ] ; then for version in 1.8.6 1.8.7 1.9.1 1.9.2 ; do rvm-install-ruby $implementation $version $patchlevel done + unset version patchlevel else - rvm-install-ruby $implementation $version $patchlevel + rvm-install-ruby $implementation $version $patchlevel fi done else rvm-install-ruby $implementation $version $patchlevel fi @@ -840,6 +816,8 @@ esac if [ "$debug" = "1" ] ; then set +x ; fi } + +if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi # magic :)