Should i sent out the whole patch again or this is enough: ?
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index bc7e145..ce432a8 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -187,7 +187,7 @@ module Util
if bin =~ /^\//
return bin if FileTest.file? bin and FileTest.executable? bin
else
- ENV['PATH'].split(":").each do |dir|
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |dir|
Cheers,
Ohad
On Mon, Oct 12, 2009 at 2:22 PM, Paul Nasrat <[email protected]> wrote:
> 2009/10/12 Ohad Levy <[email protected]>:
> > Signed-off-by: Ohad Levy <[email protected]>
> > ---
> > lib/puppet/util.rb | 17 ++++++-----------
> > 1 files changed, 6 insertions(+), 11 deletions(-)
>
> Generally good - one small cross platform change commented inline.
> >
> > diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
> > index e1e6992..bc7e145 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(":").each do |dir|
>
> Can you split on File::PATH_SEPARATOR for cross platform support
>
> > + dest=File.join(dir, bin)
> > + return dest if FileTest.file? dest and
> FileTest.executable?
> > dest
> > + end
> > end
> > + retun nil
> > end
> > module_function :binary
>
> Paul
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---