[DRE-commits] [SCM] gem2deb.git branch, master, updated. debian/0.2.3-52-g3092732

Antonio Terceiro terceiro at softwarelivre.org
Tue Jul 19 01:35:02 UTC 2011


The following commit has been merged in the master branch:
commit a56b6bdf4eb8b49f75c501810fd37ae1a9415bc7
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Sat Jul 16 13:23:03 2011 -0700

    Support multi-binary packages (Closes: #632553)
    
    Documentation will follow ;-)

diff --git a/lib/gem2deb/dh_ruby.rb b/lib/gem2deb/dh_ruby.rb
index d7148e3..c6e684d 100644
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@ -73,9 +73,13 @@ module Gem2Deb
     TEST_RUNNER = File.expand_path(File.join(File.dirname(__FILE__),'test_runner.rb'))
     LIBDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
 
+    attr_accessor :dh_auto_install_destdir
+
     def install(argv)
       puts "  Entering dh_ruby --install" if @verbose
 
+      self.dh_auto_install_destdir = argv.first
+
       supported_versions =
         if all_ruby_versions_supported?
           SUPPORTED_RUBY_VERSIONS.keys.clone
@@ -314,7 +318,13 @@ module Gem2Deb
     end
 
     def destdir_for(package)
-      File.expand_path(File.join('debian', package))
+      destdir =
+        if ENV['DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR']
+          self.dh_auto_install_destdir
+        else
+          File.join('debian', package)
+        end
+      File.expand_path(destdir)
     end
 
     def update_shebangs(package)
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index 21d1335..18c92cd 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -178,6 +178,24 @@ class DhRubyTest < Gem2DebTestCase
     end
   end
 
+  context 'using DESTDIR supplied by dh_auto_install' do
+    setup do
+      @dh_ruby = Gem2Deb::DhRuby.new
+      @dh_ruby.dh_auto_install_destdir = '/path/to/source-package/debian/tmp'
+    end
+    should 'normally install to debian/${package}' do
+      assert_match /\/debian\/foo$/, @dh_ruby.send(:destdir_for, 'foo')
+    end
+    should 'install to debian/tmp when DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR is set' do
+      saved_env = ENV['DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR']
+      ENV['DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR'] = 'yes'
+
+      assert_equal '/path/to/source-package/debian/tmp', @dh_ruby.send(:destdir_for, 'foo')
+
+      ENV['DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR'] = saved_env
+    end
+  end
+
   protected
 
   def read_installed_file(gem_dirname, package, path)

-- 
gem2deb.git



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