pivotal-sprout / sprout-wrap

Pivotal Labs uses this project with sprout, soloist and librarian-chef to build developer workstations
The Unlicense
157 stars 250 forks source link

sprout-osx-apps::virtualbox requires opscode-cookbooks/dmg >= 2.0.5 #21

Closed diclophis closed 10 years ago

diclophis commented 10 years ago

When I add sprout-osx-apps::virtualbox to my soloistrc I get this error when converging...

 ================================================================================                                                     
 Error executing action `install` on resource 'dmg_package[VirtualBox]'
 ================================================================================

 NameError
 ---------
 uninitialized constant Chef::Version::Platform

 Cookbook Trace:
 ---------------
 /Users/mavenlink/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb:66:in `class_from_file'
 /Users/mavenlink/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb:64:in `class_from_file'

 Resource Declaration:
 ---------------------
 # In /Users/mavenlink/workspace/sprout-wrap/cookbooks/sprout-osx-apps/recipes/virtualbox.rb

   3: dmg_package "VirtualBox" do
   4:   source dmg_properties['source']
   5:   checksum dmg_properties['checksum']
   6:   action :install
   7:   owner node['current_user']
   8:   type "pkg"
   9:   package_id "org.virtualbox.pkg.virtualbox"
  10: end

I have managed to work-around with this patch: https://github.com/mavenlink-cookbooks/sprout-wrap/commit/51710a036dba3e1a8b9de32ec65afaf86bfe05c4

But I am not sure if that is the conventional approach for declaring version dependencies with Cheffile. Should it be declared in the original sprout-wrap repo, or possibly in the parent sprout repos cookbooks?

hiremaga commented 10 years ago

Thanks for reporting this @diclophis!

Cheffile.lock currently specifies version 2.0.8 for the dmg cookbook.

The right place to specify this version is likely the cookbook's metadata.rb, i.e. this one for sprout-osx-apps in this case.

I'll close this issue for now as the dmg version has moved since it was reported, please re-open it if it's still a problem. A PR that fixes the problem (with a spec?) in sprout-osx-apps would be even more awesome!