diff options
| author | Pepijn Van Eeckhoudt | 2014-02-22 07:47:05 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2014-02-23 12:44:18 +0000 |
| commit | 734bda99cfe597c28823f05b3915a331b82c0873 (patch) | |
| tree | 9d56568262e869d1be997f5b7ee927aa39ff4fcb /Library | |
| parent | 80ade0e77ee6ce2a1b9ca391e3e58fa2a8381bad (diff) | |
| download | homebrew-734bda99cfe597c28823f05b3915a331b82c0873.tar.bz2 | |
jruby: fix stack overflow in jgem command.
In jruby 1.7.10 (possibly earlier) the script in bin/gem simply calls bin/jgem. The jruby formula overwrites jgem with gem in the 'prefix with j' paragraph. This way the jgem script end up calling itself infinitely causing a stack overflow crash.
Closes #26910.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/jruby.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Formula/jruby.rb b/Library/Formula/jruby.rb index 625f6d17a..95b033e35 100644 --- a/Library/Formula/jruby.rb +++ b/Library/Formula/jruby.rb @@ -9,11 +9,13 @@ class Jruby < Formula # Remove Windows files rm Dir['bin/*.{bat,dll,exe}'] - # Prefix a 'j' on some commands cd 'bin' do - Dir['*'].each do |file| - mv file, "j#{file}" unless file.match /^[j]/ - end + # Prefix a 'j' on some commands to avoid clashing with other ruby installations + ['ast', 'rake', 'rdoc', 'ri', 'testrb'].each { |f| mv f, "j#{f}" } + # Delete some unnecessary command + # gem is a wrapper script for jgem + # irb is an identical copy of jirb + ['gem', 'irb'].each { |f| rm f } end # Only keep the OS X native libraries |
