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

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


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

    Rewrite shebangs before running tests
    
    This is useful in the case where the tests depend on running some
    program in the package, but the program does not have a shebang line.
    Since rubygems adds the shebang automatically on installation, some
    upstream authors might forget to add them to the source distribution.

diff --git a/lib/gem2deb/dh_ruby.rb b/lib/gem2deb/dh_ruby.rb
index b136ed5..2aaff38 100644
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@ -91,12 +91,12 @@ module Gem2Deb
 
       install_files_and_build_extensions(package, supported_versions)
 
+      update_shebangs(package)
+
       run_tests(supported_versions)
 
       install_substvars(package, supported_versions)
 
-      update_shebangs(package)
-
       check_rubygems
 
       puts "  Leaving dh_ruby --install" if @verbose
diff --git a/test/sample/simpleprogram/Rakefile b/test/sample/simpleprogram-no-shebang/Rakefile
similarity index 74%
copy from test/sample/simpleprogram/Rakefile
copy to test/sample/simpleprogram-no-shebang/Rakefile
index 7f100ef..4fd9edb 100644
--- a/test/sample/simpleprogram/Rakefile
+++ b/test/sample/simpleprogram-no-shebang/Rakefile
@@ -4,14 +4,15 @@ require 'rake/gempackagetask'
 spec = Gem::Specification.new do |s|
   s.platform = Gem::Platform::RUBY
   s.summary = "Simple program used to test dh_ruby"
-  s.name = 'simpleprogram'
+  s.name = 'simpleprogram-no-shebang'
   s.version = '1.2.3'
   s.requirements << 'none'
   s.require_path = 'lib'
   #s.autorequire = 'rake'
   s.files = Dir.glob('{bin,man}/**/*')
+  s.test_files = ['test/runprogram.rb']
   s.description = <<EOF
-simpleprogram is a simple program that is used to test dh_ruby.
+simpleprogram-no-shebang is a simple program that is used to test dh_ruby.
 EOF
 end
 
diff --git a/test/sample/simpleprogram-no-shebang/bin/simpleprogram b/test/sample/simpleprogram-no-shebang/bin/simpleprogram
new file mode 100644
index 0000000..3bf915c
--- /dev/null
+++ b/test/sample/simpleprogram-no-shebang/bin/simpleprogram
@@ -0,0 +1,2 @@
+puts "I am a simple program without a shebang line. I suck."
+
diff --git a/test/sample/simpleprogram/man/man1/simpleprogram.1 b/test/sample/simpleprogram-no-shebang/man/man1/simpleprogram.1
similarity index 100%
copy from test/sample/simpleprogram/man/man1/simpleprogram.1
copy to test/sample/simpleprogram-no-shebang/man/man1/simpleprogram.1
diff --git a/test/sample/simpleprogram/pkg/simpleprogram-1.2.3.gem b/test/sample/simpleprogram-no-shebang/pkg/simpleprogram-no-shebang-1.2.3.gem
similarity index 58%
copy from test/sample/simpleprogram/pkg/simpleprogram-1.2.3.gem
copy to test/sample/simpleprogram-no-shebang/pkg/simpleprogram-no-shebang-1.2.3.gem
index 9bbf002..5276e90 100644
Binary files a/test/sample/simpleprogram/pkg/simpleprogram-1.2.3.gem and b/test/sample/simpleprogram-no-shebang/pkg/simpleprogram-no-shebang-1.2.3.gem differ
diff --git a/test/sample/simpleprogram-no-shebang/test/runprogram.rb b/test/sample/simpleprogram-no-shebang/test/runprogram.rb
new file mode 100644
index 0000000..141e149
--- /dev/null
+++ b/test/sample/simpleprogram-no-shebang/test/runprogram.rb
@@ -0,0 +1 @@
+exec('debian/ruby-simpleprogram-no-shebang/usr/bin/simpleprogram')

-- 
gem2deb.git



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