From 6665693e8f4cca154e3546d0ffdac9c3333dafa7 Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Mon, 20 Feb 2017 18:29:49 +0000 Subject: [PATCH] target: Fix kernel version regex for -rc field This regex currently matches the `rc` group against the added-patches-count, e.g. "00005" in "4.4.41-00005-g17b74bafccbe-dirty" and "59" in "4.4.0-59-generic". Fix this by requiring "rc" in the match. --- devlib/target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 1450d71..c93d475 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -27,7 +27,7 @@ ANDROID_SCREEN_RESOLUTION_REGEX = re.compile(r'mUnrestrictedScreen=\(\d+,\d+\)' DEFAULT_SHELL_PROMPT = re.compile(r'^.*(shell|root)@.*:/\S* [#$] ', re.MULTILINE) KVERSION_REGEX =re.compile( - r'(?P\d+)(\.(?P\d+)(\.(?P\d+)(-(rc)?(?P\d+))?)?)?(.*-g(?P[0-9a-fA-F]{7,}))?' + r'(?P\d+)(\.(?P\d+)(\.(?P\d+)(-rc(?P\d+))?)?)?(.*-g(?P[0-9a-fA-F]{7,}))?' )