Skip to content

Instantly share code, notes, and snippets.

@jharley
Created August 4, 2014 13:42
Show Gist options
  • Save jharley/52cbb9e2f460fcb986ed to your computer and use it in GitHub Desktop.
Save jharley/52cbb9e2f460fcb986ed to your computer and use it in GitHub Desktop.
vagrant-berkshelf 3.0.1 provisioning patch
--- /Users/jharley/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/action/install.rb.orig 2014-08-02 18:26:11.000000000 -0400
+++ /Users/jharley/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/action/install.rb 2014-08-03 17:50:28.000000000 -0400
@@ -37,14 +37,20 @@
def vendor(env)
check_vagrant_version(env)
env[:berkshelf].ui.info "Updating Vagrant's berkshelf: '#{env[:berkshelf].shelf}'"
- FileUtils.rm_rf(env[:berkshelf].shelf)
+ real_shelf = env[:berkshelf].shelf
+ tmp_shelf = "#{real_shelf}-tmp"
+ FileUtils.mkdir_p(real_shelf)
+ FileUtils.mkdir_p(tmp_shelf)
opts = env[:machine].config.berkshelf.to_hash
berks_opts = { berksfile: opts[:berksfile_path] }
berks_opts[:except] = opts[:except] if opts.has_key?(:except) && !opts[:except].empty?
berks_opts[:only] = opts[:only] if opts.has_key?(:only) && !opts[:only].empty?
- env[:berkshelf].ui.info berks("vendor", env[:berkshelf].shelf, berks_opts)
+ FileUtils.rm_rf(tmp_shelf)
+ env[:berkshelf].ui.info berks("vendor", tmp_shelf, berks_opts)
+ system("rsync -aW --delete #{tmp_shelf}/. #{real_shelf}/.")
+
end
def warn_disabled_but_berksfile_exists(env)
@jharley
Copy link
Author

jharley commented Aug 4, 2014

This is an updated dirty hack from the original, but is letting me have Vagrant 1.6.3+berkshelf 3.1.5+vagrant-berkshelf 3.0.1+vagrant-vmware-fusion 2.4.1 work together as I did previously when doing cookbook development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment