summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/provider/package/pkgutil.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/puppet/provider/package/pkgutil.rb b/lib/puppet/provider/package/pkgutil.rb
index 4914aa4f0..b80cf74ee 100755
--- a/lib/puppet/provider/package/pkgutil.rb
+++ b/lib/puppet/provider/package/pkgutil.rb
@@ -53,11 +53,17 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
next if line =~ /^=+> / # catalog fetch
next if line =~ /\d+:\d+:\d+ URL:/ # wget without -q
- blastsplit(line)
+ parsed = blastsplit(line)
+
+ # When finding one package, ensure we picked up the package line
+ # itself, not any pkgutil noise.
+ next if hash[:justme] and parsed[:name] != hash[:justme]
+
+ parsed
end.reject { |h| h.nil? }
if hash[:justme]
- return list[0]
+ return list[-1]
else
list.reject! { |h|
h[:ensure] == :absent