bin/autoproj_install in autoproj-2.0.3 vs bin/autoproj_install in autoproj-2.1.0.rc1
- old
+ new
@@ -46,10 +46,11 @@
@skip_stage2 = false
@autoproj_options = Array.new
@env = Hash.new
+ env['RUBYOPT'] = []
env['RUBYLIB'] = []
env['GEM_PATH'] = []
env['GEM_HOME'] = []
env['PATH'] = self.class.sanitize_env(ENV['PATH'] || "")
env['BUNDLE_GEMFILE'] = []
@@ -188,14 +189,15 @@
# The content of the default {#gemfile}
#
# @param [String] autoproj_version a constraint on the autoproj version
# that should be used
# @return [String]
- def default_gemfile_contents(autoproj_version = ">= 2.0.0.a")
+ def default_gemfile_contents(autoproj_version = ">= 2.0.0")
["source \"#{gem_source}\"",
+ "ruby \"#{RUBY_VERSION}\" if respond_to?(:ruby)",
"gem \"autoproj\", \"#{autoproj_version}\"",
- "gem \"utilrb\", \">= 3.0.0.a\""].join("\n")
+ "gem \"utilrb\", \">= 3.0.1\""].join("\n")
end
# Parse the provided command line options and returns the non-options
def parse_options(args = ARGV)
options = OptionParser.new do |opt|
@@ -258,18 +260,23 @@
if File.exist?(bundler_path)
bundler_path
end
end
- def install_bundler(gem_program)
+ def install_bundler(gem_program, silent: false)
local = ['--local'] if local?
+ redirection = Hash.new
+ if silent
+ redirection = Hash[out: :close]
+ end
+
result = system(
- env_for_child,
+ env_for_child.merge('GEM_HOME' => gems_gem_home),
Gem.ruby, gem_program, 'install', '--env-shebang', '--no-document', '--no-format-executable', '--clear-sources', '--source', gem_source,
*local,
- "--bindir=#{File.join(gems_gem_home, 'bin')}", 'bundler')
+ "--bindir=#{File.join(gems_gem_home, 'bin')}", 'bundler', **redirection)
if !result
STDERR.puts "FATAL: failed to install bundler in #{gems_gem_home}"
nil
end
@@ -571,17 +578,19 @@
end
end
def stage2(*vars)
require 'autobuild'
- puts "saving env.sh and .autoproj/env.sh"
+ puts "saving temporary env.sh and .autoproj/env.sh"
save_env_sh(*vars)
+ puts "running 'autoproj envsh' to generate a proper env.sh"
if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
STDERR.puts "failed to run autoproj envsh on the newly installed autoproj (#{autoproj_path})"
exit 1
end
# This is really needed on an existing install to install the
# gems that were present in the v1 layout
+ puts "running 'autoproj osdeps' to re-install missing gems"
if !system(Gem.ruby, autoproj_path, 'osdeps')
STDERR.puts "failed to run autoproj osdeps on the newly installed autoproj (#{autoproj_path})"
exit 1
end
end