[DRE-commits] [gem2deb] 04/08: dh_ruby: change shebangs from `/usr/bin/env ruby` to `/usr/bin/ruby`

Antonio Terceiro terceiro at moszumanska.debian.org
Mon Feb 10 16:06:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository gem2deb.

commit 6c799bffe30395c861e31c061a9aea490b72247f
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Feb 9 21:51:44 2014 -0300

    dh_ruby: change shebangs from `/usr/bin/env ruby` to `/usr/bin/ruby`
    
    - multiple interpreters won't be supported for Jessie, and any interpreter
      that is not /usr/bin/ruby will have been installed by hand so we don't
      want system binaries using external interpreters.
---
 debian/changelog            |  4 ++++
 lib/gem2deb.rb              |  2 +-
 test/unit/dh_ruby_test.rb   |  2 +-
 test/unit/installer_test.rb | 12 ++++++------
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ff62545..999c4fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,10 @@ gem2deb (0.6.2) UNRELEASED; urgency=medium
       interpreter is added there is no need to re-upload every package to
       make it seen by that new interpreter rubygems.
   * add ruby-test-unit to Build-Depends
+  * dh_ruby: change shebangs from `/usr/bin/env ruby` to `/usr/bin/ruby`
+    - multiple interpreters won't be supported for Jessie, and any interpreter
+      that is not /usr/bin/ruby will have been installed by hand so we don't
+      want system binaries using external interpreters.
 
   [ Cédric Boutillier ]
   * Make build of C extensions verbose
diff --git a/lib/gem2deb.rb b/lib/gem2deb.rb
index a9e7e56..c343379 100644
--- a/lib/gem2deb.rb
+++ b/lib/gem2deb.rb
@@ -44,7 +44,7 @@ module Gem2Deb
     'libruby2.0',
   ]
 
-  RUBY_SHEBANG_CALL = '/usr/bin/env ruby'
+  RUBY_SHEBANG_CALL = '/usr/bin/ruby'
 
   BIN_DIR = '/usr/bin'
 
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index bd0f242..57b8f8b 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -26,7 +26,7 @@ class DhRubyTest < Gem2DebTestCase
       assert_installed SIMPLE_PROGRAM_DIRNAME, 'ruby-simpleprogram', '/usr/bin/simpleprogram'
     end
     should 'rewrite shebang of installed programs' do
-      assert_match %r(#!/usr/bin/env ruby), read_installed_file(SIMPLE_PROGRAM_DIRNAME, 'ruby-simpleprogram', '/usr/bin/simpleprogram').lines.first
+      assert_match %r(#!/usr/bin/ruby), read_installed_file(SIMPLE_PROGRAM_DIRNAME, 'ruby-simpleprogram', '/usr/bin/simpleprogram').lines.first
     end
   end
 
diff --git a/test/unit/installer_test.rb b/test/unit/installer_test.rb
index 7155fc5..af7ae59 100644
--- a/test/unit/installer_test.rb
+++ b/test/unit/installer_test.rb
@@ -78,21 +78,21 @@ class InstallerTest < Gem2DebTestCase
 
       # The fact that this call does not crash means we won't crash when
       # /usr/bin has subdirectories
-      @installer.send(:rewrite_shebangs, '/usr/bin/env ruby')
+      @installer.send(:rewrite_shebangs, '/usr/bin/ruby')
     end
     teardown do
       FileUtils.rm_f(self.class.tmpdir + '/rewrite_shebangs')
     end
 
     should 'rewrite shebangs of programs directly under bin/' do
-      assert_match %r{/usr/bin/env ruby}, File.read(self.class.tmpdir + '/rewrite_shebangs/usr/bin/prog')
+      assert_match %r{/usr/bin/ruby}, File.read(self.class.tmpdir + '/rewrite_shebangs/usr/bin/prog')
     end
     should 'rewrite shebangs in subdirs of bin/' do
-      assert_match %r{/usr/bin/env ruby}, File.read(self.class.tmpdir + '/rewrite_shebangs/usr/bin/subdir/prog')
+      assert_match %r{/usr/bin/ruby}, File.read(self.class.tmpdir + '/rewrite_shebangs/usr/bin/subdir/prog')
     end
     should 'add a shebang when there is none' do
       lines = File.readlines(self.class.tmpdir + '/rewrite_shebangs/usr/bin/no-shebang')
-      assert_match %r{/usr/bin/env ruby}, lines[0]
+      assert_match %r{/usr/bin/ruby}, lines[0]
       assert_match /puts/, lines[1]
     end
     should 'not rewrite shebangs non-Ruby scripts' do
@@ -102,9 +102,9 @@ class InstallerTest < Gem2DebTestCase
     should 'leave programs with correct permissions after rewriting shebangs' do
       assert_equal '100755', '%o' % File.stat(self.class.tmpdir + '/rewrite_shebangs/usr/bin/no-shebang').mode
     end
-    should 'rewrite shebang to use `/usr/bin/env ruby` if all versions are supported' do
+    should 'rewrite shebang to use `/usr/bin/ruby` if all versions are supported' do
       @installer.stubs(:all_ruby_versions_supported?).returns(true)
-      @installer.expects(:rewrite_shebangs).with('/usr/bin/env ruby')
+      @installer.expects(:rewrite_shebangs).with('/usr/bin/ruby')
       @installer.send(:update_shebangs)
     end
     should "rewrite shebang to usr #{OLDER_RUBY_VERSION_BINARY} if only #{OLDER_RUBY_VERSION} is supported" do

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gem2deb.git



More information about the Pkg-ruby-extras-commits mailing list