From patchwork Wed Feb 10 12:23:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 45027 X-Patchwork-Delegate: stefan.bader@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 86506B7CC2 for ; Wed, 10 Feb 2010 23:24:01 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NfBbk-0006jb-7M; Wed, 10 Feb 2010 12:23:52 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NfBbh-0006iW-O3 for kernel-team@lists.ubuntu.com; Wed, 10 Feb 2010 12:23:49 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1NfBbh-0004k3-My for ; Wed, 10 Feb 2010 12:23:49 +0000 Received: from 79-66-152-200.dynamic.dsl.as9105.com ([79.66.152.200] helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NfBbh-0006ql-IZ for kernel-team@lists.ubuntu.com; Wed, 10 Feb 2010 12:23:49 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/3] UBUNTU: git-ubuntu-log -- commonise duplicated log handling Date: Wed, 10 Feb 2010 12:23:45 +0000 Message-Id: <1265804627-21720-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265804627-21720-1-git-send-email-apw@canonical.com> References: <1265804627-21720-1-git-send-email-apw@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com We have two copies of the handling for Bug: et al in get-ubuntu-log only differing in whether Ignore: handling is active. Refactor this code to share a single copy of this processing. Signed-off-by: Andy Whitcroft Acked-by: Stefan Bader --- debian/scripts/misc/git-ubuntu-log | 43 +++++++++++++---------------------- 1 files changed, 16 insertions(+), 27 deletions(-) diff --git a/debian/scripts/misc/git-ubuntu-log b/debian/scripts/misc/git-ubuntu-log index 666e831..2ac19bc 100755 --- a/debian/scripts/misc/git-ubuntu-log +++ b/debian/scripts/misc/git-ubuntu-log @@ -168,6 +168,7 @@ sub changelog_input { elsif ($pstate == 4) { next unless /^\s*?(.*)/; my $ignore = 0; + my $do_ignore = 0; my $bug = undef; my %bugz = (); my $k; @@ -180,38 +181,26 @@ sub changelog_input { $desc = $1; if ($desc =~ /^ *(Revert "|)UBUNTU:/) { - while () { - $ignore = 1 if /^ *Ignore: yes/i; - if (/^ *Bug: *(#|)(.*)/i) { - foreach $k (split('(,|)*\s*#', $2)) { - $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/)); - } - } - elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) { - $bugz{$1} = 1; - } - elsif (/^ *(CVE-.*)/) { - $cve = $1 - } - last if /^commit /; - } + $do_ignore = 1; } else { + $do_ignore = 0; $author = $kernel_auth; $ignore = 1 if $desc =~ /Merge /; - while () { - if (/^ *Bug: *(#|)(.*)/i) { - foreach $k (split('(,|)*\s*#', $2)) { - $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/)); - } - } - elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) { - $bugz{$1} = 1; - } - elsif (/^ *(CVE-.*)/) { - $cve = $1 + } + while () { + $ignore = 1 if ($do_ignore && /^ *Ignore: yes/i); + if (/^ *Bug: *(#|)(.*)/i) { + foreach $k (split('(,|)*\s*#', $2)) { + $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/)); } - last if /^commit /; } + elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) { + $bugz{$1} = 1; + } + elsif (/^ *(CVE-.*)/) { + $cve = $1 + } + last if /^commit /; } $bug = join(", #", keys(%bugz));