diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-08 15:24:26 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-08 15:24:26 -0700 |
commit | f9271b918833b250da304efa8efdd0fdb64e89ca (patch) | |
tree | 922bf531dcd3bf5ea3581c44370574f11c875e8e /lib | |
parent | a19fbb417b54f0456b02bea295efd310761f6b86 (diff) | |
download | puppet-f9271b918833b250da304efa8efdd0fdb64e89ca.tar.gz puppet-f9271b918833b250da304efa8efdd0fdb64e89ca.tar.xz puppet-f9271b918833b250da304efa8efdd0fdb64e89ca.zip |
maint: delete dead darwinport package provider
The DarwinPorts package provider was actually entirely broken; we are not
shipping or supporting it with the 2.7 release. Plans exist to introduce a
newer, functional MacPorts provider, but this dead code can be removed early.
Paired-With: Nigel Kersten <nigel@puppetlabs.com>
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/puppet/provider/package/darwinport.rb | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/lib/puppet/provider/package/darwinport.rb b/lib/puppet/provider/package/darwinport.rb deleted file mode 100755 index c5f9ba28f..000000000 --- a/lib/puppet/provider/package/darwinport.rb +++ /dev/null @@ -1,86 +0,0 @@ -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" - - def self.eachpkgashash - # list out all of the packages - open("| #{command(:port)} list installed") { |process| - regex = %r{(\S+)\s+@(\S+)\s+(\S+)} - fields = [:name, :ensure, :location] - hash = {} - - # now turn each returned line into a package object - process.each { |line| - hash.clear - - if match = regex.match(line) - fields.zip(match.captures) { |field,value| - hash[field] = value - } - - hash.delete :location - hash[:provider] = self.name - yield hash.dup - else - raise Puppet::DevError, - "Failed to match dpkg line #{line}" - end - } - } - end - - def self.instances - packages = [] - - eachpkgashash do |hash| - packages << new(hash) - end - - packages - end - - def install - should = @resource.should(:ensure) - - # Seems like you can always say 'upgrade' - output = port "upgrade", @resource[:name] - if output =~ /^Error: No port/ - raise Puppet::ExecutionFailure, "Could not find package #{@resource[:name]}" - end - end - - def query - version = nil - self.class.eachpkgashash do |hash| - return hash if hash[:name] == @resource[:name] - end - - nil - end - - def latest - info = port :search, "^#{@resource[:name]}$" - - if $CHILD_STATUS != 0 or info =~ /^Error/ - return nil - end - - ary = info.split(/\s+/) - version = ary[2].sub(/^@/, '') - - version - end - - def uninstall - port :uninstall, @resource[:name] - end - - def update - install - end -end - |