Skip to content

Instantly share code, notes, and snippets.

@jharley
Last active March 8, 2020 19:24
Show Gist options
  • Save jharley/5ac589354e41fadad0eb to your computer and use it in GitHub Desktop.
Save jharley/5ac589354e41fadad0eb to your computer and use it in GitHub Desktop.
vagrant-berkshelf 2.0.1 provisioning patch
--- /Users/jharley/.vagrant.d/gems/gems/vagrant-berkshelf-2.0.1/lib/berkshelf/vagrant/action/install.rb.orig 2014-05-02 11:02:44.000000000 -0400
+++ /Users/jharley/.vagrant.d/gems/gems/vagrant-berkshelf-2.0.1/lib/berkshelf/vagrant/action/install.rb 2014-05-03 10:36:35.000000000 -0400
@@ -42,9 +42,14 @@
def install(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.rm_rf(tmp_shelf)
+ env[:berkshelf].berksfile.vendor(tmp_shelf)
+
+ system("rsync -aW --delete #{tmp_shelf}/. #{real_shelf}/.")
- env[:berkshelf].berksfile.vendor(env[:berkshelf].shelf)
end
def warn_disabled_but_berksfile_exists(env)
@jharley
Copy link
Author

jharley commented May 3, 2014

This is a dirty hack, but is letting me have Vagrant 1.5+berkshelf 3.1+vagrant-berkshelf 2.0.1+vagrant-vmware-fusion 2.4.0 work together as I did previously when doing cookbook development.

The patch is based on a hack I was shown in #vagrant in December (for vagrant-berkshelf 1.3.7), and I can no longer find... If you shared it, please make yourself known and I'll happily give you credit and link it up.

@dpmcnevin
Copy link

Thank you very much for this! I just tried it and it works with vagrant 1.6.1 & vagrant-berkshelf 2.0.1 with vagrant-vmware-fusion 2.3.6

@jharley
Copy link
Author

jharley commented May 9, 2014

@dpmcnevin My pleasure. I figured I couldn't be the only one with this workflow. :)

@jharley
Copy link
Author

jharley commented Aug 4, 2014

I've added a new patch for vagrant-berkshelf 3.0.1 here.

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