scripts/manage in rvm-0.1.47 vs scripts/manage in rvm-1.0.0

- old
+ new

@@ -41,11 +41,11 @@ __rvm_pushpop "$source_directory" unset source_directory for patch_name in $(__rvm_current_patch_names | __rvm_strip); do patch_level="1" # If set, extract the patch level from the patch name. - if echo "$patch_name" | grep -q "$patch_level_seperator"; then + if echo "$patch_name" | \grep -q "$patch_level_seperator"; then patch_level="$(echo "$patch_name" | awk -F"$patch_level_seperator" '{print $2}')" patch_name="$(echo "$patch_name" | awk -F"$patch_level_seperator" '{print $1}')" fi full_patch_path="$(__rvm_lookup_full_patch_path "$patch_name")" # Expand paths, and for those we found we then apply the patches. @@ -61,11 +61,16 @@ __rvm_pushpop return $patch_result } __rvm_install_source() { - if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi + [[ -z "$rvm_ruby_selected_flag" ]] && __rvm_select + + if [[ "$rvm_ruby_string" = "ruby-1.9.2-head" ]] ; then + # Ensure we have a base ruby. + __rvm_ensure_has_18_compat_ruby || return 1 + fi $rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home" __rvm_pushpop "$rvm_src_path" if [[ -n "$rvm_force_flag" ]] ; then \rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi @@ -107,15 +112,25 @@ # REE stores configure flags differently for head vs. the distributed release. if [[ "ree" != "$rvm_ruby_interpreter" ]]; then __rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags" fi + # On 1.9.2, we manually set the --with-baseruby option + # to point to an expanded path. + if [[ "$rvm_ruby_string" = "ruby-1.9.2-head" ]] ; then + local compatible_baseruby="$rvm_wrappers_path/$(__rvm_18_compat_ruby)/ruby" + if [[ -x "$compatible_baseruby" ]] ; then + configure_parameters="--with-baseruby=$compatible_baseruby" + fi + fi + local configure_command="./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags $configure_parameters" __rvm_run "configure" "$configure_command" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..." + unset configure_parameters db_configure_flags result=$? ; if [[ "$result" -gt 0 ]] ; then $rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result - fi ; unset configure_parameters db_configure_flags + fi else $rvm_scripts_path/log "error" "Skipping configure step, 'configure' does not exist, did autoconf not run successfully?" fi rvm_ruby_make=${rvm_ruby_make:-"make"} @@ -468,11 +483,11 @@ fi fi if [[ -n "$rvm_head_flag" ]] ; then builtin cd $rvm_ruby_src_path - rvm_gemstone_package_file="GemStone-$(grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | \tr ' ' '-')" + rvm_gemstone_package_file="GemStone-$(\grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | \tr ' ' '-')" rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}" 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" @@ -729,16 +744,20 @@ __rvm_run "$1.copy" "\\cp -R \"$rvm_ruby_repo_path\" \"$rvm_ruby_src_path\"" "Copying from repo to source..." builtin cd "$rvm_ruby_src_path" } __rvm_fetch_ruby() { - if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi + [[ -z "$rvm_ruby_selected_flag" ]] && __rvm_select - if [[ -z "$rvm_head_flag" ]] && [[ -z "$rvm_ruby_tag" ]] && [[ -z "$rvm_ruby_revision" ]] ; then + 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="${rvm_archive_extension:-tar.gz}" + if [[ "ruby" = "$rvm_ruby_interpreter" ]]; then + rvm_archive_extension="${rvm_archive_extension:-tar.bz2}" + else + rvm_archive_extension="${rvm_archive_extension:-tar.gz}" + fi if [[ ! -s "$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension" ]] ; then if [[ "ruby" = "$rvm_ruby_interpreter" ]] ; then rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_release_version}.${rvm_major_version}_url")/$rvm_ruby_package_file.$rvm_archive_extension" elif [[ "ree" = "$rvm_ruby_interpreter" ]] ; then @@ -770,10 +789,15 @@ elif [[ "zip" = "$rvm_archive_extension" ]] ; then __rvm_run "extract" "unzip -q -o $rvm_archives_path/$rvm_ruby_package_file -d /tmp/rvm_src_$$" 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 + elif [[ "tar.bz2" = "$rvm_archive_extension" ]] ; then + __rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | bunzip2 | tar xf - -C /tmp/rvm_src_$$" "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 fi mv "/tmp/rvm_src_$$/$(\cd /tmp/rvm_src_$$ ; \ls)" "$rvm_ruby_src_path" ; \rm -rf "/tmp/rvm_src_$$" if [[ -n "$rvm_ruby_name" ]] && [[ -d "$rvm_src_path/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" ]] ; then @@ -1060,10 +1084,10 @@ __rvm_inject_gem_env "$rvm_ruby_home/bin/gem" directory_name="$rvm_ruby_home/lib/ruby/gems" version_number="${rvm_release_version}.${rvm_major_version}" if [[ "$version_number" == "." ]]; then - version_number="$(\ls "$directory_name" | grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)" + version_number="$(\ls "$directory_name" | \grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)" if [[ -n "$version_number" ]]; then ruby_lib_gem_path="${directory_name}/${version_number}" else ruby_lib_gem_path="" fi