scripts/manage in rvm-0.1.1 vs scripts/manage in rvm-0.1.2

- old
+ new

@@ -14,11 +14,10 @@ __rvm_install_source() { if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi $rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home" - mkdir -p "$rvm_ruby_log_path" __rvm_pushpop "$rvm_src_path" if [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi result=0 __rvm_fetch_ruby @@ -146,15 +145,19 @@ PATH="$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:\$PATH" ; export PATH exec $macruby_path/mac$binary_name $prefix "\$@" RubyWrapper ) + for file_name in "$rvm_ruby_home/bin/$binary_name" "$rvm_bin_path/$binary_name-$rvm_ruby_string" ; do rm -f $file_name echo "$ruby_wrapper" > $file_name if [[ -f $file_name ]] ; then chmod +x $file_name ; fi done + if [[ "$binary_name" = "ruby" ]] ; then + echo "$ruby_wrapper" > $rvm_bin_path/$rvm_ruby_string + fi unset file_name ruby_wrapper binary_name files prefix done __rvm_irbrc else $rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS." @@ -184,11 +187,10 @@ mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path" fi builtin cd "$rvm_ruby_src_path" - mkdir -p "$rvm_ruby_log_path" mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems" if [[ ! -z "$rvm_ruby_configure_flags" ]] ; then rvm_ruby_configure_flags="$(echo $rvm_ruby_configure_flags | sed 's#--#-c --#g')" fi @@ -338,11 +340,10 @@ jruby) if ! which java &> /dev/null ; then echo -e "java must be installed and in your path in order to install JRuby." ; return 1 fi - mkdir -p "$rvm_ruby_log_path" __rvm_pushpop $rvm_src_path __rvm_fetch_ruby result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result fi @@ -386,11 +387,10 @@ $rvm_scripts_path/maglev result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "Prerequisite checks have failed. Aborting the installation." ; __rvm_pushpop ; return $result fi - mkdir -p "$rvm_ruby_log_path" __rvm_pushpop $rvm_src_path if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$rvm_src_path/$rvm_ruby_string/" "$rvm_src_path/$rvm_ruby_string/" __rvm_fetch_ruby @@ -422,12 +422,12 @@ __rvm_run "gemstone.extract" "cat $rvm_archives_path/${rvm_gemstone_package_file}.${rvm_archive_extension} | gunzip | tar xf - -C $rvm_ruby_src_path" result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while trying to extract the gemstone package. Aborting the installation." ; __rvm_pushpop ; return $result fi - mv "$rvm_gemstone_package_file" "gemstone" - chmod -R 777 gemstone # for now. + chmod -R 777 "$rvm_gemstone_package_file" # for now. + ln -nfs "$rvm_gemstone_package_file" "gemstone" __rvm_pushpop if [[ -z "$rvm_ruby_home" ]] || [[ "$rvm_ruby_home" = "/" ]] ; then echo "WTH?!?! rvm_ruby_home == / ??? not removing." ; return 1000000 ; fi rm -rf $rvm_ruby_home @@ -451,18 +451,18 @@ fi #ln -fs "$rvm_ruby_home/$(echo $rvm_gemstone_package_file | awk -F'.' '{print $1}')" "$rvm_ruby_home/gemstone" if [[ ! -e ${rvm_ruby_home}/etc/conf.d/maglev.conf ]] ; then - $rvm_scripts_path/log "info" "Creating default 'maglev' repository." ; __rvm_pushpop ; return $result - $rvm_bin_path/rvm 1.8.7 rake "stone:create[maglev]" >/dev/null + $rvm_scripts_path/log "info" "Creating default 'maglev' repository." + $rvm_bin_path/rvm 1.8.7 rake "stone:create[maglev]" >/dev/null 2>&1 fi - $rvm_scripts_path/log "info" "Generating maglev HTML documentation" ; __rvm_pushpop ; return $result + $rvm_scripts_path/log "info" "Generating maglev HTML documentation" $rvm_bin_path/rvm 1.8.7 rake rdoc >/dev/null 2>&1 - $rvm_scripts_path/log "info" "Generating smalltalk FFI." ; __rvm_pushpop ; return $result + $rvm_scripts_path/log "info" "Generating smalltalk FFI." $rvm_bin_path/rvm 1.8.7 rake stwrappers >/dev/null 2>&1 # TODO: Figure out if anything needs to be done with rubygems. #__rvm_rubygems_setup @@ -477,13 +477,15 @@ fi if [[ "$rvm_head_flag" = 1 ]] ; then mono_version="$(mono -V | head -n 1 | cut -d ' ' -f5)" if $rvm_scripts_path/match "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then - if [[ ${BASH_REMATCH[1]} -lt 2 ]] || ( [[ ${BASH_REMATCH[1]} -eq 2 ]] && [[ ${BASH_REMATCH[2]} -lt 6 ]] ) ; then + mono_major_ver="$(echo $mono_version | cut -d '.' -f1)" + mono_minor_ver="$(echo $mono_version | cut -d '.' -f2)" + if [[ $mono_major_ver -lt 2 ]] || ( [[ $mono_major_ver -eq 2 ]] && [[ $mono_minor_ver -lt 6 ]] ) ; then echo -e "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository." - echo -e "Version detected: ${BASH_REMATCH[0]}" + echo -e "Version detected: ${mono_version}" return 1 fi else echo -e "Cannot recognize mono version." return 1 @@ -501,12 +503,12 @@ rm -rf $rvm_ruby_home/* mkdir -p $rvm_ruby_home/bin $rvm_ruby_home/lib $rvm_ruby_home/lib/ruby $rvm_ruby_home/lib/IronRuby cp -r $rvm_ruby_src_path/Merlin/Main/Bin/mono_release/* $rvm_ruby_home/bin/ cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/ - cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p*/lib/ruby/* $rvm_ruby_home/lib/ruby - cp -r $rvm_ruby_src_path/ruby_home/lib/IronRuby + cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/* $rvm_ruby_home/lib/ruby + cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs/* $rvm_ruby_home/lib/IronRuby else $rvm_scripts_path/log "info" "Retrieving IronRuby" $rvm_scripts_path/fetch "$rvm_url" result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result @@ -543,9 +545,12 @@ for file_name in $(echo $files) ; do rm -f $file_name echo "$ruby_wrapper" > $file_name if [[ -f $file_name ]] ; then chmod +x $file_name ; fi done + if [[ "$binary_name" = "ruby" ]] ; then + echo "$ruby_wrapper" > $rvm_bin_path/$rvm_ruby_string + fi unset file_name ruby_wrapper binary_name binary_path files prefix done ;; mput|shyouhei)