lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.0.0.rc31 vs lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.0.0.rc32
- old
+ new
@@ -35,31 +35,21 @@
env = ws.env
config = ws.config
env.add_path 'PATH', File.join(ws.prefix_dir, 'gems', 'bin')
- env.add_path 'PATH', File.join(config.bundler_gem_home, 'bin')
- env.add_path 'PATH', File.join(config.gems_gem_home(ws), 'bin')
- env.add_path 'PATH', File.join(ws.dot_autoproj_dir, 'autoproj', 'bin')
+ env.add_path 'PATH', File.join(ws.dot_autoproj_dir, 'bin')
env.set 'GEM_HOME', config.gems_gem_home(ws)
- env.set 'GEM_PATH', config.bundler_gem_home
+ env.set 'GEM_PATH', config.autoproj_gem_home
- root_dir = File.join(ws.prefix_dir, 'gems')
- gemfile_path = File.join(root_dir, 'Gemfile')
+ gemfile_path = File.join(ws.prefix_dir, 'gems', 'Gemfile')
if File.file?(gemfile_path)
env.set('BUNDLE_GEMFILE', gemfile_path)
end
- if !config.private_bundler? || !config.private_autoproj? || !config.private_gems?
- env.set('GEM_PATH', *Gem.default_path)
- end
Autobuild.programs['bundler'] = File.join(ws.dot_autoproj_dir, 'bin', 'bundler')
- if config.private_bundler?
- env.add_path 'GEM_PATH', config.bundler_gem_home
- end
-
env.init_from_env 'RUBYLIB'
env.inherit 'RUBYLIB'
# Sanitize the rubylib we get from the environment by removing
# anything that comes from Gem or Bundler
original_rubylib =
@@ -86,11 +76,11 @@
prefix_gems = File.join(ws.prefix_dir, "gems")
FileUtils.mkdir_p prefix_gems
gemfile = File.join(prefix_gems, 'Gemfile')
if !File.exist?(gemfile)
File.open(gemfile, 'w') do |io|
- io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')}\""
+ io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'Gemfile')}\""
end
end
if bundle_rubylib = discover_bundle_rubylib(silent_errors: true)
update_env_rubylib(bundle_rubylib, system_rubylib)
@@ -241,11 +231,11 @@
# Back up the existing gemfile, we'll restore it if something is
# wrong to avoid leaving bundler in an inconsistent state
backup_files(backups)
if !File.file?("#{gemfile_path}.orig")
File.open("#{gemfile_path}.orig", 'w') do |io|
- io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')}\""
+ io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'Gemfile')}\""
end
end
gemfiles = []
ws.manifest.each_package_set do |source|
@@ -255,11 +245,11 @@
end
# In addition, look into overrides.d
Dir.glob(File.join(ws.overrides_dir, "*.gemfile")) do |gemfile_path|
gemfiles << gemfile_path
end
- gemfiles << File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')
+ gemfiles << File.join(ws.dot_autoproj_dir, 'Gemfile')
# Save the osdeps entries in a temporary gemfile and finally
# merge the whole lot of it
gemfile_contents = Tempfile.open 'autoproj-gemfile' do |io|
gems.sort.each do |name|
@@ -279,13 +269,9 @@
io.puts gemfile_contents
end
end
options = Array.new
- if ws.config.private_gems?
- options << "--path" << ws.config.gems_bundler_path(ws)
- end
-
binstubs_path = File.join(root_dir, 'bin')
if updated || !install_only || !File.file?("#{gemfile_path}.lock")
self.class.run_bundler_install ws, gemfile_path, *options,
binstubs: binstubs_path
end