This is Luke's suggested fix, from the ticket.

Signed-off-by: Markus Roberts <[email protected]>
---
 lib/puppet/provider/package/blastwave.rb |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/puppet/provider/package/blastwave.rb 
b/lib/puppet/provider/package/blastwave.rb
index a2f86aa..cf2c87b 100755
--- a/lib/puppet/provider/package/blastwave.rb
+++ b/lib/puppet/provider/package/blastwave.rb
@@ -10,8 +10,9 @@ Puppet::Type.type(:package).provide :blastwave, :parent => 
:sun, :source => :sun
 
     commands :pkgget => pkgget
 
-    # This is so stupid, but then, so is blastwave.
-    ENV["PAGER"] = "/usr/bin/cat"
+    def pkgget_with_cat(*args)
+        withenv(:PAGER => "/usr/bin/cat") { pkgget(*args) }
+    end
 
     def self.extended(mod)
         unless command(:pkgget) != "pkg-get"
@@ -40,7 +41,7 @@ Puppet::Type.type(:package).provide :blastwave, :parent => 
:sun, :source => :sun
             command << hash[:justme]
         end
 
-        output = pkgget command
+        output = pkgget_with_cat command
 
         list = output.split("\n").collect do |line|
             next if line =~ /^#/
@@ -88,7 +89,7 @@ Puppet::Type.type(:package).provide :blastwave, :parent => 
:sun, :source => :sun
     end
 
     def install
-        pkgget "-f", :install, @resource[:name]
+        pkgget_with_cat "-f", :install, @resource[:name]
     end
 
     # Retrieve the version from the current package file.
@@ -107,11 +108,11 @@ Puppet::Type.type(:package).provide :blastwave, :parent 
=> :sun, :source => :sun
 
     # Remove the old package, and install the new one
     def update
-        pkgget "-f", :upgrade, @resource[:name]
+        pkgget_with_cat "-f", :upgrade, @resource[:name]
     end
 
     def uninstall
-        pkgget "-f", :remove, @resource[:name]
+        pkgget_with_cat "-f", :remove, @resource[:name]
     end
 end
 
-- 
1.6.4

--

You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.


Reply via email to