Commit 4c1f8842 by Mislav Marohnić

Avoid double shebangs when fixing Rubinius gem binstubs

This is to fix the error when installing new gems that have executables
which match existing binstubs in the Rubinius bin directory:

    "bundle" from bundler conflicts with PREFIX/gems/bin/bundle

RubyGems is supposed to override the binstub if it detects that the
previous one was also generated by RubyGems for the gem of the same
name, but its detection mechanism gets thrown off by having a double
shebang as a result of our binstubs fixing process.

https://github.com/rubygems/rubygems/blob/v2.2.2/lib/rubygems/installer.rb#L149-L154

This avoids generating binstubs with a double shebang.
parent 61448a0f
...@@ -670,7 +670,7 @@ fix_rbx_gem_binstubs() { ...@@ -670,7 +670,7 @@ fix_rbx_gem_binstubs() {
binstub="${bindir}/${file##*/}" binstub="${bindir}/${file##*/}"
rm -f "$binstub" rm -f "$binstub"
{ echo "#!${bindir}/ruby" { echo "#!${bindir}/ruby"
cat "$file" grep -v '^#!' "$file"
} > "$binstub" } > "$binstub"
chmod +x "$binstub" chmod +x "$binstub"
done done
......
...@@ -487,7 +487,6 @@ OUT ...@@ -487,7 +487,6 @@ OUT
run cat "${INSTALL_ROOT}/bin/rake" run cat "${INSTALL_ROOT}/bin/rake"
assert_output <<OUT assert_output <<OUT
#!${INSTALL_ROOT}/bin/ruby #!${INSTALL_ROOT}/bin/ruby
#!rbx
puts 'rake' puts 'rake'
OUT OUT
...@@ -495,7 +494,6 @@ OUT ...@@ -495,7 +494,6 @@ OUT
run cat "${INSTALL_ROOT}/bin/irb" run cat "${INSTALL_ROOT}/bin/irb"
assert_output <<OUT assert_output <<OUT
#!${INSTALL_ROOT}/bin/ruby #!${INSTALL_ROOT}/bin/ruby
#!rbx
print '>>' print '>>'
OUT OUT
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment