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 
    2121
    2222
    2323  def self.parse_installed_query_line(line)
    24     regex = /(\S+)\s+@(\S+)_(\S+)\s+\(active\)/
     24    regex = /(\S+)\s+@(\S+)_(\d+).*\(active\)/
    2525    fields = [:name, :ensure, :revision]
    2626    hash_from_line(line, regex, fields)
    2727  end
    Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack 
    6666  end
    6767
    6868  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
    7072  end
    7173
    7274  def latest
    7375    # We need both the version and the revision to be confident
    7476    # we've got the latest revision of a specific version
    7577    # 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)
    7779    return nil if info_line == ""
    7880
    7981    if newest = self.class.parse_info_query_line(info_line)