Added a --plugin-clean-sources parameter that will allow for

only those sources that are defined by the user to be used.
This commit is contained in:
Rob Kinyon 2014-10-28 21:53:41 -04:00
parent 4cab663189
commit 14b84a4a76
3 changed files with 14 additions and 6 deletions

4
.gitignore vendored
View File

@ -1,6 +1,10 @@
# OS-specific # OS-specific
.DS_Store .DS_Store
# Editor swapfiles
.*.sw?
*~
# Vagrant stuff # Vagrant stuff
acceptance_config.yml acceptance_config.yml
boxes/* boxes/*

View File

@ -178,11 +178,6 @@ module Vagrant
f = File.open(Tempfile.new("vagrant").path + "2", "w+") f = File.open(Tempfile.new("vagrant").path + "2", "w+")
f.tap do |gemfile| f.tap do |gemfile|
if !sources.include?("http://rubygems.org")
gemfile.puts(%Q[source "https://rubygems.org"])
end
gemfile.puts(%Q[source "http://gems.hashicorp.com"])
sources.each do |source| sources.each do |source|
next if source == "" next if source == ""
gemfile.puts(%Q[source "#{source}"]) gemfile.puts(%Q[source "#{source}"])

View File

@ -3,6 +3,11 @@ module VagrantPlugins
module Command module Command
module MixinInstallOpts module MixinInstallOpts
def build_install_opts(o, options) def build_install_opts(o, options)
options[:plugin_sources] = [
"https://rubygems.org",
"http://gems.hashicorp.com",
]
o.on("--entry-point NAME", String, o.on("--entry-point NAME", String,
"The name of the entry point file for loading the plugin.") do |entry_point| "The name of the entry point file for loading the plugin.") do |entry_point|
options[:entry_point] = entry_point options[:entry_point] = entry_point
@ -17,9 +22,13 @@ module VagrantPlugins
puts puts
end end
o.on("--plugin-clean-sources", String,
"Remove all plugin sources defined so far (including defaults)") do
options[:plugin_sources] = []
end
o.on("--plugin-source PLUGIN_SOURCE", String, o.on("--plugin-source PLUGIN_SOURCE", String,
"Add a RubyGems repository source") do |plugin_source| "Add a RubyGems repository source") do |plugin_source|
options[:plugin_sources] ||= []
options[:plugin_sources] << plugin_source options[:plugin_sources] << plugin_source
end end