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

Seth Forshee seth.forshee at canonical.com
Wed Jul 6 15:10:35 UTC 2011


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
     #
-- 
1.7.4.1





More information about the kernel-team mailing list