On 06/05/15 at 14:36 -0300, Antonio Terceiro wrote:
> On Wed, May 06, 2015 at 07:21:37PM +0200, Lucas Nussbaum wrote:
> > On 06/05/15 at 13:58 -0300, Antonio Terceiro wrote:
> > > On Wed, May 06, 2015 at 06:29:03PM +0200, Lucas Nussbaum wrote:
> > > > Package: gem2deb
> > > > Version: 0.15
> > > > Severity: minor
> > > > 
> > > > Hi,
> > > > 
> > > > It would be much nicer if gem2deb generated Build-Depends and Depends
> > > > with one item per line. It makes diffing much easier.
> > > > 
> > > > (I could make the change, but I wanted to check that I'm not the only
> > > > one thinking that first)
> > > 
> > > It would indeed be useful. since gem2deb already depends on devscripts
> > > anyway, why don't we just call wrap-and-sort at the end of the process?
> > 
> > That's an even better way to achieve that! (probably with --wrap-always)
> 
> I can't think of a reason to not want that, ever.

Hi Antonio,

Could you please review the attached patch?
I'm not sure if we should introduce an option to disable this. But I
tend to agree with you (= "I can't think of a reason to not want that, ever.")

Lucas
From d11ee113a49cdaae7c3474887300677855b8ac8f Mon Sep 17 00:00:00 2001
From: Lucas Nussbaum <lu...@debian.org>
Date: Mon, 11 May 2015 23:00:59 +0200
Subject: [PATCH] Run wrap-and-sort after generation from templates

---
 debian/changelog               | 3 +++
 lib/gem2deb/dh_make_ruby.rb    | 1 +
 test/unit/dh_make_ruby_test.rb | 6 +++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4cd68d8..8a75f14 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ gem2deb (0.16) UNRELEASED; urgency=medium
     Closes: #733171
   * bin/dh-make-ruby: use '.' (current directory) as default target.
     Closes: #777747
+  * dh-make-ruby: run wrap-and-sort after generating boilerplate from
+    templates. test/unit/dh_make_ruby_test.rb also had to be modified
+    to robustify the dependencies extractor. Closes: #784556
 
  -- Lucas Nussbaum <lu...@debian.org>  Mon, 11 May 2015 21:10:48 +0200
 
diff --git a/lib/gem2deb/dh_make_ruby.rb b/lib/gem2deb/dh_make_ruby.rb
index 156a4a2..97a883e 100644
--- a/lib/gem2deb/dh_make_ruby.rb
+++ b/lib/gem2deb/dh_make_ruby.rb
@@ -281,6 +281,7 @@ module Gem2Deb
         end
       end
       FileUtils.chmod 0755, 'debian/rules'
+      run('wrap-and-sort')
     end
 
     def templates
diff --git a/test/unit/dh_make_ruby_test.rb b/test/unit/dh_make_ruby_test.rb
index 883ef72..a96f358 100644
--- a/test/unit/dh_make_ruby_test.rb
+++ b/test/unit/dh_make_ruby_test.rb
@@ -134,9 +134,9 @@ class DhMakeRubyTest < Gem2DebTestCase
 
   context 'dependencies' do
     setup do
-      text = File.read(File.join(DEBIANIZED_SIMPLE_GEM, 'debian/control'))
-      line = text.lines.find { |l| l =~ /^Depends: / }.strip
-      @dependencies = line.gsub(/^Depends:\s*/, '').split(/\s*,\s*/)
+      file = File.join(DEBIANIZED_SIMPLE_GEM, 'debian/control')
+      deps = `grep-dctrl -sDepends -n '' #{file}`
+      @dependencies = deps.split(/\s*,\s*/)
     end
     should 'get simple dependency' do
       assert_include @dependencies, 'ruby-dep'
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

Reply via email to