diff options
author | Markus Roberts <Markus@reality.com> | 2010-11-04 13:53:23 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2010-11-12 15:02:00 +1100 |
commit | b15231df5842df2ea83b779b22e6756e51bc39d0 (patch) | |
tree | 34978db4a199ccca92e35c66e154851bc60fff27 /lib/puppet/util/reference.rb | |
parent | ea435a43dc97487d054271a9efb208f361408339 (diff) | |
download | puppet-b15231df5842df2ea83b779b22e6756e51bc39d0.tar.gz puppet-b15231df5842df2ea83b779b22e6756e51bc39d0.tar.xz puppet-b15231df5842df2ea83b779b22e6756e51bc39d0.zip |
Fix for #4299 -- Don't require which
We already had an internal implementation of which hiding under an assumed
name (Puppet::Util.binary); this commit calls it out of hiding and uses it
consisantly.
Diffstat (limited to 'lib/puppet/util/reference.rb')
-rw-r--r-- | lib/puppet/util/reference.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb index ab201cde4..95efeb1c1 100644 --- a/lib/puppet/util/reference.rb +++ b/lib/puppet/util/reference.rb @@ -39,14 +39,7 @@ class Puppet::Util::Reference Puppet::Util.secure_open("/tmp/puppetdoc.txt", "w") do |f| f.puts text end - rst2latex = %x{which rst2latex} - if $CHILD_STATUS != 0 or rst2latex =~ /no / - rst2latex = %x{which rst2latex.py} - end - if $CHILD_STATUS != 0 or rst2latex =~ /no / - raise "Could not find rst2latex" - end - rst2latex.chomp! + rst2latex = which('rst2latex') || which('rst2latex.py') || raise("Could not find rst2latex") cmd = %{#{rst2latex} /tmp/puppetdoc.txt > /tmp/puppetdoc.tex} Puppet::Util.secure_open("/tmp/puppetdoc.tex","w") do |f| # If we get here without an error, /tmp/puppetdoc.tex isn't a tricky cracker's symlink |