    # File lib/chef/provider/package/smartos.rb, line 47
                                    def check_package_state(name)
                                            Chef::Log.debug("#{@new_resource} checking package #{name}")
                                            # XXX
                                            version = nil
                                            info = shell_out!("pkg_info -E \"#{name}*\"", :env => nil, :returns => [0,1])

                                            if info.stdout
                                                    version = info.stdout[/^#{@new_resource.package_name}-(.+)/, 1]
              end

                                            if !version
                                                    @current_resource.version(nil)
                                            else
                                                    @current_resource.version(version)
                                            end
            end