Ticket #35394: patch-lib-puppet-provider-package-macports.rb.patch
File patch-lib-puppet-provider-package-macports.rb.patch, 1.3 KB (added by macports@…, 12 years ago) |
---|
-
lib/puppet/provider/package/macports.rb
Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack 21 21 22 22 23 23 def self.parse_installed_query_line(line) 24 regex = /(\S+)\s+@(\S+)_(\ S+)\s+\(active\)/24 regex = /(\S+)\s+@(\S+)_(\d+).*\(active\)/ 25 25 fields = [:name, :ensure, :revision] 26 26 hash_from_line(line, regex, fields) 27 27 end … … Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack 66 66 end 67 67 68 68 def query 69 return self.class.parse_installed_query_line(port("-q", :installed, @resource[:name])) 69 result = self.class.parse_installed_query_line(execute([command(:port), "-q", :installed, @resource[:name]], :combine => false)) 70 return {} if result.nil? 71 return result 70 72 end 71 73 72 74 def latest 73 75 # We need both the version and the revision to be confident 74 76 # we've got the latest revision of a specific version 75 77 # Note we're still not doing anything with variants here. 76 info_line = port("-q", :info, "--line", "--version", "--revision", @resource[:name])78 info_line = execute([command(:port), "-q", :info, "--line", "--version", "--revision", @resource[:name]], :combine => false) 77 79 return nil if info_line == "" 78 80 79 81 if newest = self.class.parse_info_query_line(info_line)