[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.4.3-108-ge45cef4



The following commit has been merged in the master branch:
commit e45cef4bed2f2359fae575f14b70b42c9427f4c3
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Dec 25 13:43:45 2010 +0100

    Made Lintian::Check use Email::Valid to parse emails to spot missing commas.
    
      * debian/control:
        + [NT] Introduce (build) dependency on libemail-valid-perl.
      * lib/Lintian/Check.pm:
        + [NT] Use Email::Valid to validate email addreses.
          (Closes: #602655)

diff --git a/debian/changelog b/debian/changelog
index 2117252..dd15dde 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -80,6 +80,7 @@ lintian (2.4.4) UNRELEASED; urgency=low
     + [NT] Bump debhelper build dependency to 7.0.50~, since some tests
       depend on using dh7 with override targets.  (Closes: #607730)
     + [NT] Added Niels Thykier to uploaders.
+    + [NT] Introduce (build) dependency on libemail-valid-perl.
   * debian/copyright:
     + [NT] Added Niels Thykier to maintainers.
   * debian/rules:
@@ -90,6 +91,9 @@ lintian (2.4.4) UNRELEASED; urgency=low
   * debian/compat:
     + [NT] Bump debhelper comat to 7.
 
+  * lib/Lintian/Check.pm:
+    + [NT] Use Email::Valid to validate email addreses.
+      (Closes: #602655)
   * lib/Lintian/Collect/Binary.pm:
     + [NT] Pre-sort file index and file info to avoid sorting it
       repeatedly in the checks.  (Closes: #605844)
diff --git a/debian/control b/debian/control
index 42a224f..7ed4f4c 100644
--- a/debian/control
+++ b/debian/control
@@ -21,6 +21,7 @@ Build-Depends: binutils,
                libapt-pkg-perl,
                libclass-accessor-perl,
                libdigest-sha-perl,
+               libemail-valid-perl,
                libipc-run-perl,
                libparse-debianchangelog-perl,
                libtest-minimumversion-perl,
@@ -52,6 +53,7 @@ Depends: ${misc:Depends},
          libapt-pkg-perl,
          libclass-accessor-perl,
          libdigest-sha-perl,
+         libemail-valid-perl,
          libipc-run-perl,
          libparse-debianchangelog-perl,
          libtimedate-perl,
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 6d8cb36..af13b6c 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -24,6 +24,7 @@ use strict;
 use warnings;
 
 use Exporter ();
+use Email::Valid;
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 
@@ -154,12 +155,13 @@ sub check_maintainer {
             if $field ne 'changed-by';
     }
 
-    # This should really be done with Email::Valid.  Don't issue the malformed
-    # tag twice if we already saw problems.
+    # Don't issue the malformed tag twice if we already saw problems.
     if (not $mail) {
         tag "$field-address-missing", $maintainer;
     } else {
-	if (not $malformed and $mail !~ /^[^()<>@,;:\\\"\[\]]+@(\S+\.)+\S+/) {
+	if (not $malformed and not Email::Valid->address($mail)){
+            # Either not a valid email or possibly missing a comma between
+            # two entries.
             tag "$field-address-malformed", $maintainer;
 	}
 	if ($mail =~ /(?:localhost|\.localdomain|\.localnet)$/) {
diff --git a/t/tests/fields-maintainer-general/debian/debian/control.in b/t/tests/fields-maintainer-general/debian/debian/control.in
index 0b94997..68df25e 100644
--- a/t/tests/fields-maintainer-general/debian/debian/control.in
+++ b/t/tests/fields-maintainer-general/debian/debian/control.in
@@ -3,7 +3,9 @@ Priority: extra
 Section: {$section}
 Maintainer: <lintian-maint@debian.org>
 Uploaders: <lintian-maint@debian.org>, Russ Allbery <rra@debian.org>,
- Russ Allbery <rra@debian.org>
+ Russ Allbery <rra@debian.org>,
+ Mr. Missing Comma <mrmc@comma.com>
+ Mrs. Missing Comma <mrsmc@comma.com>
 Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 7)
 
diff --git a/t/tests/fields-maintainer-general/desc b/t/tests/fields-maintainer-general/desc
index 2ff1c0d..579b26e 100644
--- a/t/tests/fields-maintainer-general/desc
+++ b/t/tests/fields-maintainer-general/desc
@@ -6,4 +6,6 @@ Test-For:
  duplicate-uploader
  maintainer-also-in-uploaders
  maintainer-name-missing
+ uploader-address-malformed
  uploader-name-missing
+
diff --git a/t/tests/fields-maintainer-general/tags b/t/tests/fields-maintainer-general/tags
index 673b7fa..dea236f 100644
--- a/t/tests/fields-maintainer-general/tags
+++ b/t/tests/fields-maintainer-general/tags
@@ -1,4 +1,5 @@
 E: fields-maintainer-general source: maintainer-name-missing <lintian-maint@debian.org>
+E: fields-maintainer-general source: uploader-address-malformed Mr. Missing Comma <mrmc@comma.com> Mrs. Missing Comma <mrsmc@comma.com>
 E: fields-maintainer-general source: uploader-name-missing <lintian-maint@debian.org>
 E: fields-maintainer-general: maintainer-name-missing <lintian-maint@debian.org>
 W: fields-maintainer-general source: changelog-should-mention-nmu

-- 
Debian package checker


Reply to: