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

[SCM] Debian package checker branch, master, updated. 5c90470446c3efdac2770ae4c92f57121c8c86f5



The following commit has been merged in the master branch:
commit 1e921a1a4f5b086a691e55ca43ac941e3a9b3b79
Author: Russ Allbery <rra@debian.org>
Date:   Thu Jul 10 23:24:47 2008 -0700

    Check maintainer addresses case-insensitively
    
    * checks/nmu:
      + [RA] When comparing maintainers, treat the right-hand side of the
        e-mail address as case-insensitive.  (Closes: #486795)

diff --git a/checks/nmu b/checks/nmu
index f3532eb..0f4b032 100644
--- a/checks/nmu
+++ b/checks/nmu
@@ -52,14 +52,14 @@ while (<CHANGELOG>) {
 		$firstline = 0 if /^\s+\S/;
 	}
 	if (/^ -- ([^>]+>)/) {
-		$uploader = $1;
+		$uploader = canonicalize($1);
 		last;
 	}
 }
 close CHANGELOG;
 
 my $version = getfield("version");
-my $maintainer = getfield("maintainer");
+my $maintainer = canonicalize(getfield("maintainer"));
 my $uploaders = getfield("uploaders");
 
 my $version_nmuness = 0;
@@ -76,7 +76,7 @@ if ($version =~ /\+b\d+$/) {
 
 my $upload_is_nmu = $uploader ne $maintainer;
 if (defined $uploaders) {
-	my @uploaders = split /,/, $uploaders;
+	my @uploaders = map { canonicalize($_) } split /,/, $uploaders;
 	$upload_is_nmu = 0 if grep /^\s*\Q$uploader\E\s*$/, @uploaders;
 }
 
@@ -114,6 +114,18 @@ sub getfield {
 	return $field;
 }
 
+# Canonicalize a maintainer address with respect to case.  E-mail addresses
+# are case-insensitive in the right-hand side.
+sub canonicalize {
+	my ($maintainer) = @_;
+	$maintainer =~ s/(<[^>\@]+\@)([\w.-]+)>/$1 . lc ($2)/e;
+	return $maintainer;
+}
+
 1;
 
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
 # vim: ts=4 sw=4
diff --git a/debian/changelog b/debian/changelog
index e845461..14b5452 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,9 @@ lintian (1.24.2) unstable; urgency=low
       entry as well as --remove.
   * checks/menus{,.desc}:
     + [ADB] Check that menu-method files include menu.h (Closes: #184104)
+  * checks/nmu:
+    + [RA] When comparing maintainers, treat the right-hand side of the
+      e-mail address as case-insensitive.  (Closes: #486795)
   * checks/patch-systems{,.desc}:
     + [RA] Check quilt patches as well as dpatch patches, and also check
       quilt patches when using the 3.0 (quilt) package format.  Fix build
diff --git a/testset/copyright/debian/control b/testset/copyright/debian/control
index a63a572..535d77a 100644
--- a/testset/copyright/debian/control
+++ b/testset/copyright/debian/control
@@ -2,7 +2,7 @@ Source: copyright
 Section: text
 Priority: optional
 Maintainer: Lintian Maintainers <lintian-maint@debian.org>
-Uploaders: Tobias Toedter <t.toedter@gmx.net>
+Uploaders: Tobias Toedter <t.toedter@GMX.NET>
 Build-Depends-Indep: debhelper (>5)
 Standards-Version: 3.8.0
 
diff --git a/testset/dh7-minimal/debian/changelog b/testset/dh7-minimal/debian/changelog
index 8b0b079..6b7a730 100644
--- a/testset/dh7-minimal/debian/changelog
+++ b/testset/dh7-minimal/debian/changelog
@@ -1,6 +1,6 @@
 dh7-minimal (1) unstable; urgency=low
 
-  * Initial release
+  * Initial release, also testing case-insensitive matching.
 
- -- Russ Allbery <rra@debian.org>  Fri, 06 Jun 2008 17:20:53 -0700
+ -- Russ Allbery <rra@Debian.ORG>  Fri, 06 Jun 2008 17:20:53 -0700
 

-- 
Debian package checker


Reply to: