[DRE-commits] [SCM] gem2deb.git branch, master, updated. 0.2.7-15-g0f4aa06

Antonio Terceiro terceiro at softwarelivre.org
Sun Sep 11 20:38:24 UTC 2011


The following commit has been merged in the master branch:
commit 32478701b5e03e384281d4baf74df52d834b5e82
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Sun Sep 11 13:04:13 2011 -0700

    Keep correct permission bits on rewritten programs

diff --git a/lib/gem2deb/dh_ruby.rb b/lib/gem2deb/dh_ruby.rb
index 1eee19a..b136ed5 100644
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@ -349,6 +349,7 @@ module Gem2Deb
           end
           output.print input.read
         end
+        File.chmod(0755, path)
       end
     end
 
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index 21e67e5..a0e03b0 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -153,6 +153,9 @@ class DhRubyTest < Gem2DebTestCase
       assert_match %r{/usr/bin/ruby}, lines[0]
       assert_match /puts/, lines[1]
     end
+    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
   end
 
   context 'checking for require "rubygems"' do

-- 
gem2deb.git



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