[PATCH][kteam-tools] ktl: update debian.py to deal with two-number kernel versions

Brad Figg brad.figg at canonical.com
Tue Jul 12 14:28:43 UTC 2011


On 07/06/2011 08:10 AM, Seth Forshee wrote:
> The version string parsing assumes a kernel version with three
> numbers. This isn't currently the case for oneiric, so update the
> regexes to make the third number optional.
>
> Signed-off-by: Seth Forshee<seth.forshee at canonical.com>
> ---
>   ktl/debian.py |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ktl/debian.py b/ktl/debian.py
> index 35dd182..809817e 100644
> --- a/ktl/debian.py
> +++ b/ktl/debian.py
> @@ -25,11 +25,11 @@ class DebianError(Exception):
>   class Debian:
>       verbose = False
>       debug = False
> -    version_line_rc = compile("^(linux[-\S]*) \(([0-9]+\.[0-9]+\.[0-9]+[-\.][0-9]+\.[0-9]+[~\S]*)\) (\S+); urgency=\S+$")
> -    version_rc      = compile("^([0-9]+\.[0-9]+\.[0-9]+)[-\.]([0-9]+)\.([0-9]+)([~\S]*)$")
> +    version_line_rc = compile("^(linux[-\S]*) \(([0-9]+\.[0-9]+(?:\.[0-9]+)?[-\.][0-9]+\.[0-9]+[~\S]*)\) (\S+); urgency=\S+$")
> +    version_rc      = compile("^([0-9]+\.[0-9]+(?:\.[0-9]+)?)[-\.]([0-9]+)\.([0-9]+)([~\S]*)$")
>
>       package_rc = compile("^(linux[-\S])*.*$")
> -    ver_rc     = compile("^linux[-\S]* \(([0-9]+\.[0-9]+\.[0-9]+[-\.][0-9]+\.[0-9]+[~a-z0-9]*)\).*$")
> +    ver_rc     = compile("^linux[-\S]* \(([0-9]+\.[0-9]+(?:\.[0-9]+)?[-\.][0-9]+\.[0-9]+[~a-z0-9]*)\).*$")
>
>       # debian_directories
>       #

Acked-by: Brad Figg <brad.figg at canonical.com>

-- 
Brad Figg brad.figg at canonical.com http://www.canonical.com




More information about the kernel-team mailing list