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:
parent
e968901fe6
commit
03561ee72c
@ -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'])
|
||||||
self.sha1 = match.group('sha1')
|
if groups['minor'] is not None:
|
||||||
self.rc = match.group('rc')
|
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')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '{} {}'.format(self.release, self.version)
|
return '{} {}'.format(self.release, self.version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user