bin/vagrant in vagrant-unbundled-2.2.14.0 vs bin/vagrant in vagrant-unbundled-2.2.16.0
- old
+ new
@@ -21,13 +21,13 @@
if idx = argv.index("--")
argv_extra = argv.slice(idx+1, argv.length-2)
argv = argv.slice(0, idx)
end
+require_relative "../lib/vagrant/version"
# Fast path the version of Vagrant
if argv.include?("-v") || argv.include?("--version")
- require_relative "../lib/vagrant/version"
puts "Vagrant #{Vagrant::VERSION}"
exit 0
end
# Disable plugin loading for commands where plugins are not required. This will
@@ -80,17 +80,43 @@
# Stdout/stderr should not buffer output
$stdout.sync = true
$stderr.sync = true
+# Before we start activate all our dependencies
+# so we can provide correct resolutions later
+builtin_specs = []
+
+vagrant_spec = Gem::Specification.find_all_by_name("vagrant").detect do |spec|
+ spec.version == Gem::Version.new(Vagrant::VERSION)
+end
+
+dep_activator = proc do |spec|
+ spec.runtime_dependencies.each do |dep|
+ gem(dep.name, *dep.requirement.as_list)
+ dep_spec = Gem::Specification.find_all_by_name(dep.name).detect(&:activated?)
+ if dep_spec
+ builtin_specs << dep_spec
+ dep_activator.call(dep_spec)
+ end
+ end
+end
+
+if vagrant_spec
+ dep_activator.call(vagrant_spec)
+end
+
env = nil
begin
require 'log4r'
require 'vagrant'
require 'vagrant/bundler'
require 'vagrant/cli'
require 'vagrant/util/platform'
require 'vagrant/util/experimental'
+
+ # Set our list of builtin specs
+ Vagrant::Bundler.instance.builtin_specs = builtin_specs
# Schedule the cleanup of things
at_exit(&Vagrant::Bundler.instance.method(:deinit))
# If this is not a pre-release disable verbose output