diff mbox

[kteam-tools] ktl: fix Debian.changelog LP: bug matching

Message ID 1460991187-24337-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa April 18, 2016, 2:53 p.m. UTC
Changelog parsing for "LP: #NNNNNN" is bugged in two ways, making it
consider any "#N" string to be a Launchpad bug number.  For example,
it thinks this changelog line is a bug number:
  * PKCS#7: pkcs7_validate_trust(): initialize the _trusted output
So verify-release-ready yields: "LP: #7 is not package linux: fail"

Make it work work as intended:
 - use search() instead of match(), to find lines *containing* "LP: #NNNNNN"
 - fix the conditional, so that it actually acts on the result of that

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 ktl/debian.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Brad Figg April 18, 2016, 5:58 p.m. UTC | #1
On Mon, Apr 18, 2016 at 07:53:07AM -0700, Kamal Mostafa wrote:
> Changelog parsing for "LP: #NNNNNN" is bugged in two ways, making it
> consider any "#N" string to be a Launchpad bug number.  For example,
> it thinks this changelog line is a bug number:
>   * PKCS#7: pkcs7_validate_trust(): initialize the _trusted output
> So verify-release-ready yields: "LP: #7 is not package linux: fail"
> 
> Make it work work as intended:
>  - use search() instead of match(), to find lines *containing* "LP: #NNNNNN"
>  - fix the conditional, so that it actually acts on the result of that
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  ktl/debian.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ktl/debian.py b/ktl/debian.py
> index 6b67cfc..dd2703a 100644
> --- a/ktl/debian.py
> +++ b/ktl/debian.py
> @@ -176,8 +176,8 @@ class Debian:
>                  bugs = []
>              else:
>                  # find bug numbers and append them to the list
> -                bug_line_matches = cls.bug_line_rc.match(line)
> -                if bug_line_matches != 0:
> +                bug_line_matches = cls.bug_line_rc.search(line)
> +                if bug_line_matches:
>                      bug_matches = findall(cls.bug_rc,line)
>                      if bug_matches:
>                          bugs.extend( bug_matches )
> -- 
> 2.7.4
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Looks fine to me
diff mbox

Patch

diff --git a/ktl/debian.py b/ktl/debian.py
index 6b67cfc..dd2703a 100644
--- a/ktl/debian.py
+++ b/ktl/debian.py
@@ -176,8 +176,8 @@  class Debian:
                 bugs = []
             else:
                 # find bug numbers and append them to the list
-                bug_line_matches = cls.bug_line_rc.match(line)
-                if bug_line_matches != 0:
+                bug_line_matches = cls.bug_line_rc.search(line)
+                if bug_line_matches:
                     bug_matches = findall(cls.bug_rc,line)
                     if bug_matches:
                         bugs.extend( bug_matches )