pkgutil.rb.patch
| pkgutil.rb Mon Nov 1 18:12:41 2010 | ||
|---|---|---|
| 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 |
if line =~ /\s*(\S+)\s+(\S+)\s+(.*)/
|
|
| 71 | 71 |
hash = {}
|
| 72 | 72 |
hash[:name] = $1 |
| 73 |
hash[:ensure] = if $2 == "[Not installed]"
|
|
| 73 |
hash[:ensure] = if $2 == "notinst"
|
|
| 74 | 74 |
:absent |
| 75 | 75 |
else |
| 76 | 76 |
$2 |
| 77 | 77 |
end |
| 78 |
hash[:avail] = $5
|
|
| 78 |
hash[:avail] = $3
|
|
| 79 | 79 | |
| 80 | 80 |
if hash[:avail] == "SAME" |
| 81 | 81 |
hash[:avail] = hash[:ensure] |