scripts/manage in rvm-0.0.999 vs scripts/manage in rvm-0.0.9999

- old
+ new

@@ -174,11 +174,12 @@ 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 rm -rf "$rvm_ruby_src_path" - __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file..." + __rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." + result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result fi mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path" @@ -247,14 +248,15 @@ $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 fi fi - __rvm_run "extract" "tar xzf $rvm_archives_path/$(basename $rvm_url) -C $rvm_src_path" "Extracting $(basename $rvm_url) ..." - result=$? ; if [[ "$result" -gt 0 ]] ; then - $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result - fi + __rvm_run "extract" "cat $rvm_archives_path/$(basename $rvm_url) | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." + + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi mv "$rvm_src_path/rubinius-$rvm_ruby_version-${rvm_ruby_patch_level/^p//}" $rvm_ruby_src_path else __rvm_db "rubinius_repo_url" "rvm_ruby_repo_url" #rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version" if [[ ! -d "$rvm_ruby_src_path" ]] || [[ ! -d "$rvm_ruby_src_path/.git" ]] ; then @@ -375,10 +377,89 @@ for rvm_gem_name in jruby-openssl ; do __rvm_run "gems" "$rvm_ruby_home/bin/gem install $rvm_gem_name $rvm_gem_options" "Installing $rvm_gem_name" done ; unset rvm_gem_name ;; + maglev) + export rvm_install_on_use_flag=1 ; $rvm_bin_path/rvm 1.8.7 --install # This should install if missing. + + $rvm_scripts_path/log "info" "Running MagLev prereqs checking script." + $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 + 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 + fi + + $rvm_scripts_path/log "info" "Downloading the gemstone package, this may take a while depending on your connection..." + $rvm_scripts_path/fetch "$rvm_gemstone_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the gemstone package. Aborting the installation." ; __rvm_pushpop ; return $result + fi + + builtin cd "$rvm_src_path" + + mv "$rvm_ruby_package_file" "$rvm_ruby_string" + + builtin cd "$rvm_ruby_src_path" + + __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. + + __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 + __rvm_run "install" "/bin/cp -Rf $rvm_ruby_src_path $rvm_ruby_home" "Installing maglev to $rvm_ruby_home" + + __rvm_pushpop $rvm_ruby_home/bin/ + for binary in maglev-irb maglev-ruby maglev-gem ; do + ln -nfs $binary ${binary#maglev-} + done ; unset binary + __rvm_pushpop + + for binary in maglev-ruby maglev-irb maglev-gem ; do + __rvm_inject_gem_env $rvm_ruby_home/bin/$binary + done ; unset binary + + builtin cd "$rvm_ruby_home" + + #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 + fi + + $rvm_scripts_path/log "info" "Generating maglev HTML documentation" ; __rvm_pushpop ; return $result + $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_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 + __rvm_irbrc + __rvm_bin_script + __rvm_use + ;; + ironruby|ir) if ! which mono &> /dev/null ; then echo -e "mono must be installed and in your path in order to install IronRuby." ; return 1 fi @@ -416,11 +497,11 @@ $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 fi - __rvm_run "extract" "unzip $rvm_archives_path/$rvm_ruby_package_file ironruby/bin/* ironruby/lib/* -d $rvm_ruby_home" "Extracting $rvm_ruby_package_file ..." + __rvm_run "extract" "unzip -q -o $rvm_archives_path/$rvm_ruby_package_file ironruby/bin/* ironruby/lib/* -d $rvm_ruby_home" "Extracting $rvm_ruby_package_file ..." result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result fi mv $rvm_ruby_home/ironruby/* $rvm_ruby_home @@ -543,33 +624,46 @@ if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi if [[ -z "$rvm_head_flag" ]] && [[ -z "$rvm_ruby_tag" ]] && [[ -z "$rvm_ruby_revision" ]] ; then rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_string"}" rvm_ruby_package_file="${rvm_ruby_package_file:-"$rvm_ruby_package_name"}" - rvm_archive_extension="tar.gz" + rvm_archive_extension="${rvm_archive_extension:-tar.gz}" if [[ ! -s "$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension" ]] ; then if [[ "ruby" = "$rvm_ruby_interpreter" ]] ; then rvm_url="ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_file.$rvm_archive_extension" elif [[ "ree" = "$rvm_ruby_interpreter" ]] ; then rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")/$rvm_ruby_package_file.$rvm_archive_extension" elif [[ "jruby" = "$rvm_ruby_interpreter" ]] ; then rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_url")/$rvm_ruby_version/$rvm_ruby_package_file.$rvm_archive_extension" + elif [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then + : # Should already be set from selector else rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_url")/$rvm_ruby_package_file.$rvm_archive_extension" fi $rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..." $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 fi - fi - __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." - result=$? ; if [[ "$result" -gt 0 ]] ; then - $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result - fi + # Only re-extract if forced. + if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ ! -z "$rvm_force_flag" ]] ; then + if [[ "tar.gz" = "$rvm_archive_extension" ]] || [[ "tgz" = "$rvm_archive_extension" ]] ; then + __rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + elif [[ "zip" = "$rvm_archive_extension" ]] ; then + __rvm_run "extract" "unzip -q -o $rvm_archives_path/$rvm_ruby_package_file -d $rvm_src_path" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract $rvm_ruby_package_file. Aborting the installation." ; __rvm_pushpop ; return $result + fi + fi + else + $rvm_scripts_path/log "info" "$rvm_ruby_src_path has already been extracted." ; __rvm_pushpop ; return 0 + fi else if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then if [[ -d "$rvm_ruby_src_path/.git" ]] ; then builtin cd $rvm_ruby_src_path if [[ -z "$rvm_ruby_revision" ]] ; then @@ -729,10 +823,10 @@ $rvm_scripts_path/fetch "$rvm_gem_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 fi mkdir -p "$rvm_src_path/$rvm_gem_package_name" - __rvm_run "rubygems.extract" "tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_src_path" "Extracting $rvm_gem_package_name" + __rvm_run "rubygems.extract" "cat $rvm_archives_path/$rvm_gem_package_name.tgz | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_gem_package_name ..." fi builtin cd "$rvm_src_path/$rvm_gem_package_name" __rvm_run "rubygems.install" "GEM_PATH=$rvm_gem_path GEM_HOME=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby" result=$? if [[ $result -eq 0 ]] ; then