...
 
Commits (7)
......@@ -25,7 +25,7 @@ my $builder = Module::Build->new(
'Debian::Copyright' => '0.2',
'Dpkg::Version' => 0,
'Parse::DebianChangelog' => 0,
'Email::Address' => 0,
'Email::Address::XS' => '1.01',
'List::MoreUtils'=>0,
'Readonly'=>0,
'File::Slurp' => 0,
......
license-reconcile (0.15) UNRELEASED; urgency=medium
license-reconcile (0.15) unstable; urgency=medium
[ Salvatore Bonaccorso ]
* Update Vcs-* headers for switch to salsa.debian.org
-- Salvatore Bonaccorso <carnil@debian.org> Sun, 25 Feb 2018 15:15:23 +0100
[ gregor herrmann ]
* Apply patch to use Email::Address::XS instead of Email::Address::XS.
Thanks to Pali Rohár for the bug report and the patch.
(Closes: #887550)
* debian/control: libemail-address-perl → libemail-address-xs-perl.
* Update years of packaging copyright.
* Declare compliance with Debian Policy 4.1.4.
* Bump debhelper compatibility level to 10.
* autopkgtest: add debian/tests/pkg-perl/smoke-tests in order to not run
(and fail on) test data which look like test scripts.
-- gregor herrmann <gregoa@debian.org> Sat, 30 Jun 2018 20:32:04 +0200
license-reconcile (0.14) unstable; urgency=medium
......
......@@ -4,7 +4,7 @@ Uploaders: gregor herrmann <gregoa@debian.org>
Section: devel
Testsuite: autopkgtest-pkg-perl
Priority: optional
Build-Depends: debhelper (>= 9),
Build-Depends: debhelper (>= 10),
libmodule-build-perl,
perl (>= 5.18),
bash-completion
......@@ -13,7 +13,7 @@ Build-Depends-Indep: licensecheck (>= 3.0.29),
libconfig-any-perl,
libdebian-copyright-perl (>= 0.2),
libdpkg-perl,
libemail-address-perl,
libemail-address-xs-perl,
libfile-fnmatch-perl,
libfile-mmagic-perl,
libfile-slurp-perl,
......@@ -32,7 +32,7 @@ Build-Depends-Indep: licensecheck (>= 3.0.29),
libuniversal-require-perl,
libyaml-libyaml-perl,
libsoftware-license-perl
Standards-Version: 3.9.8
Standards-Version: 4.1.4
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/license-reconcile
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/license-reconcile.git
......@@ -45,7 +45,7 @@ Depends: ${misc:Depends},
libconfig-any-perl,
libdebian-copyright-perl (>= 0.2),
libdpkg-perl,
libemail-address-perl,
libemail-address-xs-perl,
libfile-fnmatch-perl,
libfile-mmagic-perl,
libfile-slurp-perl,
......
......@@ -47,7 +47,7 @@ Copyright: 2012, 2015, Nicholas Bamber <nicholas@periapt.co.uk>
2015, Damyan Ivanov <dmn@debian.org>
2015. Dominique Dumont <dod@debian.org>
2013, Salvatore Bonaccorso <carnil@debian.org>
2013-2016, gregor herrmann <gregoa@debian.org>
2013-2018, gregor herrmann <gregoa@debian.org>
2013, Axel Beckert <abe@debian.org>
License: Artistic or GPL-1+
......
# don't try to run tests in subdirectories which happen to be test data
t/*.t
......@@ -4,33 +4,7 @@ use 5.006;
use strict;
use warnings;
use base qw(Debian::LicenseReconcile::Filter);
use Readonly;
Readonly my $ACTUAL_NAME_RE => '\pL[\s\pL\-\'\.]*\pL';
# See http://www.faqs.org/rfcs/rfc2822.html
# Section 3.4.1
use Email::Address;
Readonly my $EMAIL_RE => $Email::Address::addr_spec;
Readonly 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;
Readonly 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;
use Email::Address::XS 1.01;
sub get_info {
my $self = shift;
......@@ -42,17 +16,23 @@ sub get_info {
my $date = $_->Date;
my @date_pieces = split( " ", $date );
my $year = $date_pieces[3];
if (my %changes = ($_->Changes =~ m/$EMAIL_CHANGES_RE/xmsg)) {
if (my %changes = ($_->Changes =~ m/^\s+\*\sEmail\schange:\s+(.*?)\s+->\s+(.*?)\s*$/xmsg)) {
# This way round since we are going backward in time thru changelog
foreach my $p (keys %changes) {
$changes{$p} =~ s{[\s\n]+$}{}xms;
# Parse bare email address; undef if it not an email address
my $address = Email::Address::XS->parse_bare_address($changes{$p})->address();
if ($address) {
$changes{$p} = $address;
} else {
delete $changes{$p};
}
}
%email_changes = (
%changes,
%email_changes
);
}
if (my ($name) = ($person =~ $PERSON_PARSE_RE)) {
if (my $name = Email::Address::XS->parse($person)->phrase()) {
if (exists $email_changes{$name}) {
$person = "$name <$email_changes{$name}>";
}
......