r50132 - in /trunk/dh-make-perl: TODO debian/changelog debian/copyright dh-make-perl lib/DhMakePerl.pm lib/DhMakePerl/Config.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jan 4 09:11:03 UTC 2010


Author: gregoa
Date: Mon Jan  4 09:10:52 2010
New Revision: 50132

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50132
Log:
New option "--only": update only specified file in --refresh mode.

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

Modified: trunk/dh-make-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/TODO?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/TODO (original)
+++ trunk/dh-make-perl/TODO Mon Jan  4 09:10:52 2010
@@ -30,3 +30,5 @@
   adds a leading "0" (even worse). we somehow need to get those versions
   back. or strip the "v". or something. - at least if the tarball is
   Foo-Bar-v1.2.0.
+* cleanup lib/DhMakePerl.pm: Changes is extracted and never used, fix_rules
+  doesn't fix rules anymore but only writes examples and docs, ...

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Mon Jan  4 09:10:52 2010
@@ -13,6 +13,7 @@
   * Add Provides and Replaces to lib/Debian/Control/Stanza{,/Binary}.pm.
   * Uppercase "DISCLAIMER" in generated debian/copyright to make it more
     easily visible.
+  * New option "--only": update only specified file in --refresh mode.
 
   [ Salvatore Bonaccorso ]
   * debian/copyright: Update to revision 135 of DEP5 Format-Specification for

Modified: trunk/dh-make-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/copyright?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/copyright (original)
+++ trunk/dh-make-perl/debian/copyright Mon Jan  4 09:10:52 2010
@@ -10,10 +10,10 @@
  2003, 2004, Marc 'HE' Brockschmidt <he at debian.org>
  2005-2007, Gunnar Wolf <gwolf at debian.org>
  2006, Frank Lichtenheld <djpig at debian.org>
- 2007-2009, gregor herrmann <gregoa at debian.org>
+ 2007-2010, gregor herrmann <gregoa at debian.org>
  2007-2009, Damyan Ivanov <dmn at debian.org>
  2008, Roberto C. Sanchez <roberto at connexer.com>
- 2009, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
+ 2009-2010, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
 License: GPL-2
 
 License: GPL-2

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Mon Jan  4 09:10:52 2010
@@ -20,7 +20,7 @@
 
 =item dh-make-perl [--make] {I<SOURCE_DIR> | --cpan I<MODULE>} I<options...>
 
-=item dh-make-perl --refresh I<options...>
+=item dh-make-perl --refresh {I<--only ...>}
 
 =item dh-make-perl --locate Foo::Bar
 
@@ -271,6 +271,11 @@
 
 Default: ~/.dh-make-perl
 
+=item B<--only> | B<-o> I<control|copyright|docs|examples|rules>
+
+This option allows to update only one specific file in the debian/ directory
+when B<dh-make-perl> is run in L</--refresh> mode.
+
 =item B<--packagename> | B<-p> I<PACKAGENAME>
 
 Manually specify the Package Name, useful when the module has dashes in its

Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Mon Jan  4 09:10:52 2010
@@ -196,14 +196,14 @@
         $self->main_dir('.');
 
         die $self->debian_file('rules.bak') . " already exists. Aborting!\n"
-            if -e $self->debian_file('rules.bak');
+            if ( -e $self->debian_file('rules.bak') and 'rules' ~~ $self->cfg->only );
 
         die $self->debian_file('copyright.bak')
             . " already exists. Aborting!\n"
-            if -e $self->debian_file('copyright.bak');
+            if ( -e $self->debian_file('copyright.bak') and 'copyright' ~~ $self->cfg->only );
 
         die $self->debian_file('control.bak') . " already exists. Aborting!\n"
-            if -e $self->debian_file('control.bak');
+            if ( -e $self->debian_file('control.bak') and 'control' ~~ $self->cfg->only );
 
         $self->process_meta;
         ( $pkgname, $version )
@@ -212,47 +212,58 @@
             = ( -f $self->main_file('Build.PL') ) ? "Module-Build" : "MakeMaker";
 
         $self->extract_changelog;
-        $self->extract_docs;
-        $self->extract_examples;
+        $self->extract_docs if 'docs' ~~ $self->cfg->only;
+        $self->extract_examples if 'examples' ~~ $self->cfg->only;
         print "Found changelog: $changelog\n"
             if defined $changelog and $self->cfg->verbose;
-        print "Found docs: @docs\n" if $self->cfg->verbose;
+        print "Found docs: @docs\n" if @docs and $self->cfg->verbose;
         print "Found examples: @examples\n" if @examples and $self->cfg->verbose;
-        $self->backup_file( $self->debian_file('rules') );
-        $self->create_rules( $self->debian_file('rules') );
-        if (! -f $self->debian_file('compat') or $self->cfg->dh == 7) {
-            $self->create_compat( $self->debian_file('compat') );
-        }
+
+        if ( 'rules' ~~ $self->cfg->only ) {
+            $self->backup_file( $self->debian_file('rules') );
+            $self->create_rules( $self->debian_file('rules') );
+            if (! -f $self->debian_file('compat') or $self->cfg->dh == 7) {
+                $self->create_compat( $self->debian_file('compat') );
+            }
+        }
+
+        if ( 'docs' ~~ $self->cfg->only or 'examples' ~~ $self->cfg->only) {
         $self->fix_rules( $self->debian_file('rules'),
             ( defined $changelog ? $changelog : '' ),
             \@docs, \@examples, );
-        $self->backup_file( $self->debian_file('copyright') );
-        $self->create_copyright("$debiandir/copyright");
-
-        my $control = Debian::Control::FromCPAN->new;
-        $control->read( $self->debian_file('control') );
-        if ( -e catfile( $self->debian_file('patches'), 'series' ) ) {
-            $self->add_quilt( $control );
-        }
-        else {
-            $self->drop_quilt( $control );
-        }
-
-        if( my $apt_contents = $self->get_apt_contents ) {
-            $control->dependencies_from_cpan_meta(
-                $self->meta, $self->get_apt_contents, $self->cfg->verbose );
-        }
-        else {
-            warn "No APT contents can be loaded.\n";
-            warn "Please install 'apt-file' package and run 'apt-file update'\n";
-            warn "as root.\n";
-            warn "Dependencies not updated.\n";
-        }
-
-        $control->prune_perl_deps();
-
-        $self->backup_file( $self->debian_file('control') );
-        $control->write( $self->debian_file('control') );
+        }
+
+        if ( 'copyright' ~~ $self->cfg->only ) {
+            $self->backup_file( $self->debian_file('copyright') );
+            $self->create_copyright("$debiandir/copyright");
+        }
+
+        if ( 'control' ~~ $self->cfg->only ) {
+            my $control = Debian::Control::FromCPAN->new;
+            $control->read( $self->debian_file('control') );
+            if ( -e catfile( $self->debian_file('patches'), 'series' ) ) {
+                $self->add_quilt( $control );
+            }
+            else {
+                $self->drop_quilt( $control );
+            }
+
+            if( my $apt_contents = $self->get_apt_contents ) {
+                $control->dependencies_from_cpan_meta(
+                    $self->meta, $self->get_apt_contents, $self->cfg->verbose );
+            }
+            else {
+                warn "No APT contents can be loaded.\n";
+                warn "Please install 'apt-file' package and run 'apt-file update'\n";
+                warn "as root.\n";
+                warn "Dependencies not updated.\n";
+            }
+
+            $control->prune_perl_deps();
+
+            $self->backup_file( $self->debian_file('control') );
+            $control->write( $self->debian_file('control') );
+        }
 
         print "--- Done\n" if $self->cfg->verbose;
         return 0;

Modified: trunk/dh-make-perl/lib/DhMakePerl/Config.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Config.pm?rev=50132&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Config.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Config.pm Mon Jan  4 09:10:52 2010
@@ -26,6 +26,7 @@
     'exclude|i:s{,}',  'help',
     'home-dir=s',      'install!',
     'nometa',          'notest',
+    'only|o=s@{,}',
     'packagename|p=s', 'pkg-perl!',
     'requiredeps',     'sources-list=s',
     'verbose!',        'version=s',
@@ -63,6 +64,7 @@
     email        => '',
     exclude      => qr/$Dpkg::Source::Package::diff_ignore_default_regexp/,
     home_dir     => "$ENV{HOME}/.dh-make-perl",
+    only         => ['control', 'copyright', 'docs', 'examples', 'rules'],
     verbose      => 1,
 };
 




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