[PATCH][kteam-tools] ktl: Don't treat all strings matching "#[0-9]+" as a bug numbers

Seth Forshee seth.forshee at canonical.com
Wed Aug 10 15:30:39 UTC 2016


On Wed, Aug 10, 2016 at 07:34:51AM -0700, Kamal Mostafa wrote:
> On Tue, Aug 09, 2016 at 10:26:10AM -0500, Seth Forshee wrote:
> > The bug number regular expression matching correctly identifies
> > lines containing launchpad bug numbers, but once such a line is
> > identified it treats any string matching "#[0-9]+" as a bug
> > number. For example, in this changelog entry #1 is identified as
> > a bug number:
> > 
> >   * [LTCTest][Opal][OP820] Machine crashed with Oops: Kernel access of bad area,
> >     sig: 11 [#1] while executing Froze PE Error injection (LP: #1603449)
> > 
> > Rather than matching the "LP: #NNNNNN" string and the bug number
> > separately, they can be combined into one regex which matches
> > against the full string but returns only the bug number portion
> > of the string.
> 
> I believe the current implementation is designed to work wth changelog
> entries like the following, which would be broken by your patch:
> 
> linux/xenial$  egrep 'LP: #[0-9].*#' debian.master/changelog
>     - LP: #1395877, #1410480
>     - LP: #1395877, #1410480
>     - LP: #1310512, #1320070
>     - LP: #1085766, #462111
>     - LP: #1017717, #225
>     - LP: #978038, #987371
>     - LP: #915941, #918212
>     - LP: #915941, #918212
>     - LP: #907377, #911236
>     - LP: #737388, #782389, #794642
>     [...]
> 
> How about implementing it like this?:
> 
> First trim away everything up to and including the first "LP:" from
> the line buffer, then parse every remaining instance of '#([0-9]+)' and
> consider each to be an LP bug number.

Okay, I didn't realize they could be structured that way. In that case
your suggestion makes more sense. Hopefully it's not valid for free form
text to follow a "LP: #NNNNNNN" tag?

Thanks,
Seth




More information about the kernel-team mailing list