[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1456-g2f0b1e5

James Turnbull james at lovedthanlost.net
Tue Oct 27 17:05:56 UTC 2009


The following commit has been merged in the upstream branch:
commit 54ded1bd2b8c023d6e480c21f1b2b03f3b7859ba
Author: Ohad Levy <ohadlevy at gmail.com>
Date:   Mon Oct 12 10:17:22 2009 +0800

    Fixes #1719, this avoids calling the external binary *which* everytime we are looking for a binary

diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index e1e6992..6f83c7a 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -185,19 +185,14 @@ module Util
 
     def binary(bin)
         if bin =~ /^\//
-            if FileTest.file? bin and FileTest.executable? bin
-                return bin
-            else
-                return nil
-            end
+            return bin if FileTest.file? bin and FileTest.executable? bin
         else
-            x = %x{which #{bin} 2>/dev/null}.chomp
-            if x == ""
-                return nil
-            else
-                return x
-            end
+           ENV['PATH'].split(File::PATH_SEPARATOR).each do |dir|
+               dest=File.join(dir, bin)
+               return dest if FileTest.file? dest and FileTest.executable? dest
+           end
         end
+        return nil
     end
     module_function :binary
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list