On Tue, Jul 21, 2009 at 4:04 PM, Luke Kanies<[email protected]> wrote: > > On Jul 21, 2009, at 4:03 PM, Nigel Kersten wrote: > >> >> On Tue, Jul 21, 2009 at 3:57 PM, Luke Kanies<[email protected]> wrote: >>> >>> I don't suppose you want to add starts to tests for these providers, >>> do you? Even testing these bits would be helpful... >> >> mmm. writing tests for other people's code :) > > Well, no - I mean writing tests for the new bits you added.
So all I did was remove defaultfor: on one provider, add it to another, and swap the confines from a file based specification to a operatingsystem one. We had a brief chat about this in IRC, but I'm unsure what you want added for this patch.... > >> >> I'll have a look at them all this weekend and try and get some test >> coverage in. >> >> I've been considering deploying MacPorts anyway, so I may as well look >> at how that provider works. >>> >>> On Jul 21, 2009, at 9:29 AM, Nigel Kersten wrote: >>> >>>> >>>> >>>> Signed-off-by: Nigel Kersten <[email protected]> >>>> --- >>>> lib/puppet/provider/package/appdmg.rb | 3 ++- >>>> lib/puppet/provider/package/apple.rb | 4 +--- >>>> lib/puppet/provider/package/darwinport.rb | 2 +- >>>> lib/puppet/provider/package/pkgdmg.rb | 5 +++-- >>>> 4 files changed, 7 insertions(+), 7 deletions(-) >>>> >>>> diff --git a/lib/puppet/provider/package/appdmg.rb b/lib/puppet/ >>>> provider/package/appdmg.rb >>>> index 5d64eff..352f873 100644 >>>> --- a/lib/puppet/provider/package/appdmg.rb >>>> +++ b/lib/puppet/provider/package/appdmg.rb >>>> @@ -16,7 +16,8 @@ require 'puppet/provider/package' >>>> Puppet::Type.type(:package).provide(:appdmg, :parent => >>>> Puppet::Provider::Package) do >>>> desc "Package management which copies application bundles to a >>>> target." >>>> >>>> - confine :exists => "/Library/Receipts" >>>> + confine :operatingsystem => :darwin >>>> + >>>> commands :hdiutil => "/usr/bin/hdiutil" >>>> commands :curl => "/usr/bin/curl" >>>> commands :ditto => "/usr/bin/ditto" >>>> diff --git a/lib/puppet/provider/package/apple.rb b/lib/puppet/ >>>> provider/package/apple.rb >>>> index b211b7e..063470f 100755 >>>> --- a/lib/puppet/provider/package/apple.rb >>>> +++ b/lib/puppet/provider/package/apple.rb >>>> @@ -8,11 +8,9 @@ Puppet::Type.type(:package).provide :apple, :parent >>>> => Puppet::Provider::Package >>>> automatically add the ``.pkg`` extension, so leave that off >>>> when specifying >>>> the package name." >>>> >>>> - confine :exists => "/Library/Receipts" >>>> + confine :operatingsystem => :darwin >>>> commands :installer => "/usr/sbin/installer" >>>> >>>> - defaultfor :operatingsystem => :darwin >>>> - >>>> def self.instances >>>> instance_by_name.collect do |name| >>>> self.new( >>>> diff --git a/lib/puppet/provider/package/darwinport.rb b/lib/puppet/ >>>> provider/package/darwinport.rb >>>> index 73d5f39..7829438 100755 >>>> --- a/lib/puppet/provider/package/darwinport.rb >>>> +++ b/lib/puppet/provider/package/darwinport.rb >>>> @@ -3,8 +3,8 @@ require 'puppet/provider/package' >>>> Puppet::Type.type(:package).provide :darwinport, :parent => >>>> Puppet::Provider::Package do >>>> desc "Package management using DarwinPorts on OS X." >>>> >>>> + confine :operatingsystem => :darwin >>>> commands :port => "/opt/local/bin/port" >>>> - confine :operatingsystem => "Darwin" >>>> >>>> def self.eachpkgashash >>>> # list out all of the packages >>>> diff --git a/lib/puppet/provider/package/pkgdmg.rb b/lib/puppet/ >>>> provider/package/pkgdmg.rb >>>> index 8f11a0a..8a916d5 100644 >>>> --- a/lib/puppet/provider/package/pkgdmg.rb >>>> +++ b/lib/puppet/provider/package/pkgdmg.rb >>>> @@ -30,8 +30,9 @@ require 'facter/util/plist' >>>> >>>> Puppet::Type.type(:package).provide :pkgdmg, :parent => >>>> Puppet::Provider::Package do >>>> desc "Package management based on Apple's Installer.app and >>>> DiskUtility.app. This package works by checking the contents of a >>>> DMG image for Apple pkg or mpkg files. Any number of pkg or mpkg >>>> files may exist in the root directory of the DMG file system. Sub >>>> directories are not checked for packages. See `the wiki docs </ >>>> trac/ >>>> puppet/wiki/DmgPackages>` for more detail." >>>> - >>>> - confine :exists => "/Library/Receipts" >>>> + >>>> + confine :operatingsystem => :darwin >>>> + defaultfor :operatingsystem => :darwin >>>> commands :installer => "/usr/sbin/installer" >>>> commands :hdiutil => "/usr/bin/hdiutil" >>>> commands :curl => "/usr/bin/curl" >>>> -- >>>> 1.6.3.3 >>>> >>>> >>>>> >>> >>> >>> -- >>> It's not that I'm afraid to die. I just don't want to be there when >>> it >>> happens. -- Woody Allen >>> --------------------------------------------------------------------- >>> Luke Kanies | http://reductivelabs.com | http://madstop.com >>> >>> >>>> >>> >> >> >> >> -- >> Nigel Kersten >> [email protected] >> System Administrator >> Google, Inc. >> >> > > > > -- > America believes in education: the average professor earns more money > in a year than a professional athlete earns in a whole week. > -- Evan Esar > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > > -- Nigel Kersten [email protected] System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
