r53046 - in /trunk/dh-make-perl: debian/changelog lib/DhMakePerl.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri Feb 19 08:31:35 UTC 2010


Author: dmn
Date: Fri Feb 19 08:31:23 2010
New Revision: 53046

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53046
Log:
do not rewrite completely debian/rules if it looks like using DH7 tiny rules

this allows for any customizations to dh7.tiny-style to be kept on --refresh

Thanks to Salvatore Bonaccorso for reporting

Modified:
    trunk/dh-make-perl/debian/changelog
    trunk/dh-make-perl/lib/DhMakePerl.pm

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=53046&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Fri Feb 19 08:31:23 2010
@@ -19,6 +19,8 @@
   * --refresh: fix pruning of binary package dependencies
     + also fix pruning of redundant perl(-base) (build-)dependencies
   * when looking for READMEs to include in .docs, skip debian/README.source
+  * do not rewrite completely debian/rules if it looks like using DH7 tiny
+    rules
 
   [ gregor herrmann ]
   * DhMakePerl: update_file_list() allows to --refresh --only docs and

Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=53046&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Fri Feb 19 08:31:23 2010
@@ -1562,6 +1562,24 @@
 
     my ( $rulesname, $error );
     $rulesname = 'rules.dh7.tiny';
+
+    # if debian/rules already exists, check if it looks like usind Debhelper 7
+    # tiny rules. If it does, ldo not re-create the file as it may have
+    # valuable customizations
+    if ( -e $file ) {
+        my @rules;
+        tie @rules, 'Tie::File', $file or die "Error opening '$file': $!";
+
+        for ( 0 .. $#rules - 1 ) {
+            if (    $rules[$_] =~ /^%:/
+                and $rules[ $_ + 1 ] =~ /^\tdh .* \$\@/ )
+            {
+                print "$file already yses DH7 tiny rules\n"
+                    if $self->cfg->verbose;
+                return;
+            }
+        }
+    }
 
     for my $source (
         catfile( $self->cfg->home_dir, $rulesname ),




More information about the Pkg-perl-cvs-commits mailing list