# File lib/puppet/provider/package/dpkg.rb, line 40
40:   def self.parse_line(line)
41:     if match = self::REGEX.match(line)
42:       hash = {}
43: 
44:       self::FIELDS.zip(match.captures) { |field,value|
45:         hash[field] = value
46:       }
47: 
48:       hash[:provider] = self.name
49: 
50:       if hash[:status] == 'not-installed'
51:         hash[:ensure] = :purged
52:       elsif ['config-files', 'half-installed', 'unpacked', 'half-configured'].include?(hash[:status])
53:         hash[:ensure] = :absent
54:       end
55:       hash[:ensure] = :held if hash[:desired] == 'hold'
56:     else
57:       Puppet.warning "Failed to match dpkg-query line #{line.inspect}"
58:       return nil
59:     end
60: 
61:     hash
62:   end