r56121 - in /trunk/dh-make-perl: lib/Debian/Rules.pm t/rules.t
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Thu Apr 15 08:50:58 UTC 2010
Author: dmn
Date: Thu Apr 15 08:50:46 2010
New Revision: 56121
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56121
Log:
Rules: fix the checkfor using dh7tiny-style rules
The old check was broken as the strings contain the final \n
Thanks to Salvatore Bonaccorso
Added:
trunk/dh-make-perl/t/rules.t
Modified:
trunk/dh-make-perl/lib/Debian/Rules.pm
Modified: trunk/dh-make-perl/lib/Debian/Rules.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/Rules.pm?rev=56121&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/Rules.pm (original)
+++ trunk/dh-make-perl/lib/Debian/Rules.pm Thu Apr 15 08:50:46 2010
@@ -105,7 +105,7 @@
$self->_is_quiltified(0);
for ( my $i = 1; $i < @{ $self->lines }; $i++ ) {
- if ( $self->lines->[$i] eq '%:'
+ if ( $self->lines->[$i] =~ /^%:/
and $i + 1 < @{ $self->lines }
and $self->lines->[ $i + 1 ] =~ /^\tdh .*\$\@/ )
{
Added: trunk/dh-make-perl/t/rules.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/rules.t?rev=56121&op=file
==============================================================================
--- trunk/dh-make-perl/t/rules.t (added)
+++ trunk/dh-make-perl/t/rules.t Thu Apr 15 08:50:46 2010
@@ -1,0 +1,16 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+BEGIN {
+ use_ok('Debian::Rules');
+};
+
+my $r = Debian::Rules->new(
+ { lines => [ "#!/usr/bin/make -f\n", "%:\n", "\tdh \$\@\n" ] } );
+
+is( @{ $r->lines }, 3, 'lines initialized properly' );
+ok( $r->is_dh7tiny, "Detects simple dh7tiny-style rules" );
More information about the Pkg-perl-cvs-commits
mailing list