Hi!

On Wed, 2021-11-24 at 16:02:22 -0600, William 'jawn-smith' Wilson wrote:
> Package: dpkg
> Severity: minor
> Tags: patch
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu jammy ubuntu-patch

> dpkg-source will do a check for a scenario where the maintainer field in
> d/control does not contain "ubuntu" and the DEBEMAIL environment
> variable ends in @ubuntu.com. There are some Canonical employees that
> use an @canonical.com email address instead, so we should expand this
> check to also trigger on DEBEMAIL values that end in @canonical.com

> In Ubuntu, the attached patch was applied to achieve the following:
> 
> Have dpkg-source fail in the aforementioned scenario, rather than a
> warning.
> 
>   * scripts/Dpkg/Vendor/Ubuntu.pm: when checking for the correct
>     maintainer field, also look for @canonical.com email addresses
>     (LP: #1951988)

I think the patch was missing checking for canonical also in the
field. Attached what I'm planning to merge. Let me know if the address
I used in the attribution is correct or you'd prefer something else
(just copied the one in the email)?

Thanks,
Guillem
From ca991d0c7c844fa2ea86ffddc66089d08c26c246 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Wed, 24 Nov 2021 23:48:06 +0100
Subject: [PATCH] Dpkg::Vendor::Ubuntu: Update Maintainer field logic to
 include canonical

Some Ubuntu maintainers use addresses with @canonical.com, handle those
in the check.

Closes: #1000557
Based-on-patch-by: William 'jawn-smith' Wilson <william.wil...@canonical.com>
Signed-off-by: Guillem Jover <guil...@debian.org>
---
 scripts/Dpkg/Vendor/Ubuntu.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
index 0352a127d..e222088ff 100644
--- a/scripts/Dpkg/Vendor/Ubuntu.pm
+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
@@ -54,8 +54,8 @@ sub run_hook {
         # https://wiki.ubuntu.com/DebianMaintainerField
         if (defined($fields->{'Version'}) and defined($fields->{'Maintainer'}) and
            $fields->{'Version'} =~ /ubuntu/) {
-           if ($fields->{'Maintainer'} !~ /ubuntu/i) {
-               if (length $ENV{DEBEMAIL} and $ENV{DEBEMAIL} =~ /\@ubuntu\.com/) {
+           if ($fields->{'Maintainer'} !~ /(?:ubuntu|canonical)/i) {
+               if (length $ENV{DEBEMAIL} and $ENV{DEBEMAIL} =~ /\@(?:ubuntu|canonical)\.com/) {
                    error(g_('Version number suggests Ubuntu changes, but Maintainer: does not have Ubuntu address'));
                } else {
                    warning(g_('Version number suggests Ubuntu changes, but Maintainer: does not have Ubuntu address'));
-- 
2.34.0

Reply via email to