pkgutil_4258_gpg.patch
| pkgutil.rb 2010-11-11 16:56:59.373588000 +0000 | ||
|---|---|---|
| 67 | 67 | |
| 68 | 68 |
# Split the different lines into hashes. |
| 69 | 69 |
def self.blastsplit(line) |
| 70 |
if line =~ /\s*(\S+)\s+((\[Not installed\])|(\S+))\s+(\S+)/ |
|
| 70 |
# When use_gpg is enabled, pkgutil talks on stdout |
|
| 71 |
return nil if line =~ /^Checking integrity / |
|
| 72 |
# And gpg talks on stderr about verification results |
|
| 73 |
return nil if line =~ /^gpg: / |
|
| 74 | ||
| 75 |
if line =~ /\s*(\S+)\s+(\S+)\s+(.*)/ |
|
| 71 | 76 |
hash = {}
|
| 72 | 77 |
hash[:name] = $1 |
| 73 |
hash[:ensure] = if $2 == "[Not installed]"
|
|
| 78 |
hash[:ensure] = if $2 == "notinst"
|
|
| 74 | 79 |
:absent |
| 75 | 80 |
else |
| 76 | 81 |
$2 |
| 77 | 82 |
end |
| 78 |
hash[:avail] = $5
|
|
| 83 |
hash[:avail] = $3
|
|
| 79 | 84 | |
| 80 | 85 |
if hash[:avail] == "SAME" |
| 81 | 86 |
hash[:avail] = hash[:ensure] |