bin/autoproj_bootstrap in autoproj-1.7.13 vs bin/autoproj_bootstrap in autoproj-1.7.14.rc1

- old
+ new

@@ -684,11 +684,16 @@ def filter_uptodate_gems(gems) # Don't install gems that are already there ... gems = gems.dup gems.delete_if do |name, version| version_requirements = Gem::Requirement.new(version || '>= 0') - installed = Gem.source_index.find_name(name, version_requirements) + installed = + if Gem.source_index.respond_to?(:find_by_name) + Gem.source_index.find_by_name(name, version_requirements) + else + Gem.source_index.find_name(name, version_requirements) + end if !installed.empty? && Autobuild.do_update # Look if we can update the package ... dep = Gem::Dependency.new(name, version_requirements) available = gem_fetcher.find_matching(dep, true, true, OSDependencies.gem_with_prerelease) installed_version = installed.map(&:version).max @@ -1368,40 +1373,25 @@ File.join(Autoproj.root_dir, subdir, "env.sh") else File.join(Autoproj.root_dir, "env.sh") end - File.open(filename, "w") do |io| - variables = [] - Autobuild.environment.each do |name, value| - variables << name - shell_line = "#{name}=#{value.join(":")}" - if Autoproj.env_inherit?(name) - if value.empty? - next - else - shell_line << ":$#{name}" - end + shell_dir = File.expand_path(File.join("..", "..", "shell"), File.dirname(__FILE__)) + if Autoproj.shell_helpers? && shell = ENV['SHELL'] + shell_kind = File.basename(shell) + if shell_kind =~ /^\w+$/ + shell_file = File.join(shell_dir, "autoproj_#{shell_kind}") + if File.exists?(shell_file) + Autoproj.progress + Autoproj.progress "autodetected the shell to be #{shell_kind}, sourcing autoproj shell helpers" + Autoproj.progress "add \"Autoproj.shell_helpers = false\" in autoproj/init.rb to disable" + Autobuild.env_source_file(shell_file) end - io.puts shell_line end - variables.each do |var| - io.puts "export #{var}" - end + end - shell_dir = File.expand_path(File.join("..", "..", "shell"), File.dirname(__FILE__)) - if Autoproj.shell_helpers? && shell = ENV['SHELL'] - shell_kind = File.basename(shell) - if shell_kind =~ /^\w+$/ - shell_file = File.join(shell_dir, "autoproj_#{shell_kind}") - if File.exists?(shell_file) - Autoproj.progress - Autoproj.progress "autodetected the shell to be #{shell_kind}, sourcing autoproj shell helpers" - Autoproj.progress "add \"Autoproj.shell_helpers = false\" in autoproj/init.rb to disable" - io.puts "source \"#{shell_file}\"" - end - end - end + File.open(filename, "w") do |io| + Autobuild.export_env_sh(io) end end # Load a definition file given at +path+. +source+ is the package set from # which the file is taken.