[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:20:56 UTC 2009


The following commit has been merged in the master branch:
commit cab5d85dea17f3ea09343955f29eb47c8b32a05d
Author: James Turnbull <james at lovedthanlost.net>
Date:   Sat Sep 13 15:01:57 2008 +1000

    Fixed #1571 - Puppet::Util::binary returns incorrect results

diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 94c96db..ff9858e 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -220,19 +220,14 @@ module Util
 
     def binary(bin)
         if bin =~ /^\//
-            if FileTest.exists? bin
+            if FileTest.file? bin and FileTest.executable? bin
                 return bin
             else
                 return nil
             end
         else
-            # LAK:NOTE See http://snurl.com/21zf8  [groups_google_com] 
-            x = ENV['PATH'].split(":").each do |dir|
-                if FileTest.exists? File.join(dir, bin)
-                    return File.join(dir, bin)
-                end
-            end
-            return nil
+            x = %x{which #{bin} 2>/dev/null}.chomp
+            return x
         end
     end
     module_function :binary

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list