1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

target: Make KernelVersion fields numerical

This commit is contained in:
Brendan Jackman 2017-02-20 17:51:17 +00:00
parent e968901fe6
commit 03561ee72c

View File

@ -1209,11 +1209,15 @@ class KernelVersion(object):
self.rc = None self.rc = None
match = KVERSION_REGEX.match(version_string) match = KVERSION_REGEX.match(version_string)
if match: if match:
self.version_number = match.group('version') groups = match.groupdict()
self.major = match.group('major') self.version_number = int(groups['version'])
self.minor = match.group('minor') self.major = int(groups['major'])
if groups['minor'] is not None:
self.minor = int(groups['minor'])
if groups['rc'] is not None:
self.rc = int(groups['rc'])
if groups['sha1'] is not None:
self.sha1 = match.group('sha1') self.sha1 = match.group('sha1')
self.rc = match.group('rc')
def __str__(self): def __str__(self):
return '{} {}'.format(self.release, self.version) return '{} {}'.format(self.release, self.version)