Issue #11004 has been updated by Rahul Gopinath.

Assignee set to Rahul Gopinath

changing parse_line to self.class.parse_line works. Here is my test case and 
patch.

    --- a/lib/puppet/provider/package/pkg.rb
    +++ b/lib/puppet/provider/package/pkg.rb
    @@ -69,7 +69,7 @@ Puppet::Type.type(:package).provide :pkg, :parent => 
Puppet::Provider::Package d
       def latest
         version = nil
         pkg(:list, "-Ha", @resource[:name]).each_line do |line|
    -      v = parse_line(line.chomp)[:status]
    +      v = self.class.parse_line(line.chomp)[:status]
           case v
           when "known"
             return v
    # cat ../t.pp 
    Package { provider => 'pkg' }

    package { 'text/gnu-patch':
      ensure => latest,
    }

    file {'tst':
     path => '/tmp/xxx',
     content => 'Hai',
     require => Package['text/gnu-patch']
    }

----------------------------------------
Feature #11004: Solaris 11 GA & pkg
https://projects.puppetlabs.com/issues/11004#change-67416

Author: Robert van Veelen
Status: Code Insufficient
Priority: Normal
Assignee: Rahul Gopinath
Category: package
Target version: 
Affected Puppet version: 
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/719


Oracle has changed the output format of pkg again for the final release of s11. 
The "status" field is no longer present in the output of "pkg list -H". There 
is now an IFO field that has the following status flags (from the man page):

         The last column contains a set of flags  that  show  the
         status of the package:

             o    An i in the I column shows that the package  is
                  installed.

             o    An f in the F column shows that the package  is
                  frozen.

             o    An o in the O column shows that the package  is
                  obsolete.  An  r in the O column shows that the
                  package has been renamed  (a  form  of  obsole-
                  tion).

Using the work done for Bug #7986 , I have tried the following with some 
success (though this only uses the 'I' column):



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to