r68077 - in /trunk/dh-make-perl: debian/changelog debian/control dh-make-perl lib/DhMakePerl/Command/Packaging.pm

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Mon Jan 31 22:34:09 UTC 2011


Author: periapt-guest
Date: Mon Jan 31 22:34:00 2011
New Revision: 68077

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=68077
Log:
TODO:
- man page change is not correct
- Agreed with Gregor that the email regex is too retsrictive.
* Added logic to parse special email change directives in the changelog
  so that the refresh command respects email changes (Closes: #609409)

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

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=68077&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Mon Jan 31 22:34:00 2011
@@ -1,7 +1,16 @@
 dh-make-perl (0.71-2) UNRELEASED; urgency=low
 
+  TODO:
+  - man page change is not correct
+  - Agreed with Gregor that the email regex is too retsrictive.
+
+  [ gregor herrmann ]
   * Fix "Tries to mkdir directory in home of building user": set HOME to a
     writable directory in debian/rules (closes: #609469).
+
+  [ Nicholas Bamber ]
+  * Added logic to parse special email change directives in the changelog
+    so that the refresh command respects email changes (Closes: #609409)
 
  -- gregor herrmann <gregoa at debian.org>  Mon, 10 Jan 2011 19:27:04 +0100
 

Modified: trunk/dh-make-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/control?rev=68077&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/control (original)
+++ trunk/dh-make-perl/debian/control Mon Jan 31 22:34:00 2011
@@ -37,7 +37,8 @@
  Oliver Gorwits <oliver.gorwits at oucs.ox.ac.uk>,
  Ryan Niebur <ryan at debian.org>, Nathan Handler <nhandler at ubuntu.com>,
  Salvatore Bonaccorso <carnil at debian.org>,
- Maximilian Gass <mxey at cloudconnected.org>
+ Maximilian Gass <mxey at cloudconnected.org>,
+ Nicholas Bamber <nicholas at periapt.co.uk>
 Standards-Version: 3.9.1
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/dh-make-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/dh-make-perl/

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=68077&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Mon Jan 31 22:34:00 2011
@@ -84,6 +84,17 @@
 C<refresh> also tries to update dependency lists in F<debian/control> from
 F<META.yml>. It hooks L<quilt(1)> into F<debian/rules> and creates
 F<debian/README.source>
+
+When updating F<debian/copyright> dh-make-perl tries to be clever about
+remembering email addresses. It gets the list of copyright holders and their
+emails for F<debian/*> from the sign off lines in F<debian/changelog>.
+However to allow for email addresses changing, it looks for change lines
+of the form
+
+      * Email change: Debbie Devlin -> devlin at debian.org
+
+So now C<Debbie Devlin <devlin at debian.org> > will be used in the copyright
+instead of C<Debbie Devlin <debbie at devlin.org> >.
 
 =item B<--only> | B<-o> I<control|copyright|docs|examples|rules>
 

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm?rev=68077&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm Mon Jan 31 22:34:00 2011
@@ -996,17 +996,50 @@
     return sprintf( "http://search.cpan.org/dist/%s/", $self->perlname );
 }
 
+
+my $ACTUAL_NAME_RE = '\pL[\s\pL\-\'\.]*\pL';
+my $EMAIL_RE = '[\w\.\-\+]+\@[\w\.\-]+';
+
+my $EMAIL_CHANGES_RE = qr{
+    ^                           # beginining of line
+    \s+\*\s                     # item marker
+    Email\schange:\s            # email change token
+    ($ACTUAL_NAME_RE)           # actual name
+    \s+->\s+                    # gap between name and email
+    ($EMAIL_RE)                 # email address
+    $                           # end of line
+}xms;
+
+my $PERSON_PARSE_RE = qr{
+    \A                          # beginining of string
+    ($ACTUAL_NAME_RE)           # actual name
+    \s                          # gap
+    \<$EMAIL_RE\>               # logged email
+    \z                          # end of string
+}xms;
+
+# This is what needs fixing.
 sub copyright_from_changelog {
     my ( $self, $firstmaint, $firstyear ) = @_;
     my %maintainers = ();
     @{ $maintainers{$firstmaint} } = ($firstyear);
     my $chglog = Parse::DebianChangelog->init(
         { infile => $self->debian_file('changelog') } );
+    my %email_changes = ();
     foreach ( $chglog->data() ) {
         my $person      = $_->Maintainer;
         my $date        = $_->Date;
         my @date_pieces = split( " ", $date );
         my $year        = $date_pieces[3];
+        if (my %changes = ($_->Changes =~ m/$EMAIL_CHANGES_RE/xmsg)) {
+            # This way round since we are going backward in time thru changelog
+            %email_changes = (%changes, %email_changes);
+        }
+        if (my ($name) = ($person =~ $PERSON_PARSE_RE)) {
+            if (exists $email_changes{$name}) {
+                $person = "$name <$email_changes{$name}>";
+            }
+        }
         if ( defined( $maintainers{$person} ) ) {
             push @{ $maintainers{$person} }, $year;
             @{ $maintainers{$person} } = sort( @{ $maintainers{$person} } );




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