[DRE-commits] [gem2deb] 02/02: gem installer: avoid installing the debian/

Antonio Terceiro terceiro at moszumanska.debian.org
Fri Nov 20 21:31:47 UTC 2015


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

terceiro pushed a commit to branch master
in repository gem2deb.

commit 89a82986dc7b7f3c263a65149c1c517e280f752c
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Fri Nov 20 19:29:20 2015 -0200

    gem installer: avoid installing the debian/
---
 debian/changelog                |  7 +++++++
 lib/gem2deb/gem_installer.rb    | 11 +++++++++++
 test/unit/gem_installer_test.rb |  4 +++-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index cafc098..4399cb6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+gem2deb (0.24) UNRELEASED; urgency=medium
+
+  * gem installer: avoid installing the debian/ directory when upstream
+    metadata specifies the packages files as '**/*'
+
+ -- Antonio Terceiro <terceiro at debian.org>  Fri, 20 Nov 2015 19:28:16 -0200
+
 gem2deb (0.23) experimental; urgency=medium
 
   * dh_ruby:
diff --git a/lib/gem2deb/gem_installer.rb b/lib/gem2deb/gem_installer.rb
index 85d63e5..cf5c9bd 100644
--- a/lib/gem2deb/gem_installer.rb
+++ b/lib/gem2deb/gem_installer.rb
@@ -93,6 +93,17 @@ module Gem2Deb
           end
         end
 
+        # remove debian/ directory that could be installed if gemspec specifies
+        # Dir['**/*'] or something equivalent
+        debian_dir = File.join(
+          destdir_base,
+          target_dir,
+          'gems',
+          [metadata.name, metadata.version].join('-'),
+          'debian'
+        )
+        FileUtils.rm_rf(debian_dir)
+
         # remove tmpdir
         FileUtils.rm_f(tmpdir)
 
diff --git a/test/unit/gem_installer_test.rb b/test/unit/gem_installer_test.rb
index 8969ea0..16e09a6 100644
--- a/test/unit/gem_installer_test.rb
+++ b/test/unit/gem_installer_test.rb
@@ -20,6 +20,8 @@ class GemInstallerTest < Gem2DebTestCase
     assert_file_exists INSTALLDIR  + '/usr/bin/install_as_gem'
   end
 
-  should 'not install debian/ directory'
+  should 'not install debian/ directory' do
+    assert_no_file_exists INSTALLDIR + '/usr/share/rubygems-integration/all/gems/install_as_gem-0.0.1/debian'
+  end
 
 end

-- 
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