mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	target: Make KernelVersion fields numerical
This commit is contained in:
		@@ -1209,11 +1209,15 @@ class KernelVersion(object):
 | 
			
		||||
        self.rc = None
 | 
			
		||||
        match = KVERSION_REGEX.match(version_string)
 | 
			
		||||
        if match:
 | 
			
		||||
            self.version_number = match.group('version')
 | 
			
		||||
            self.major = match.group('major')
 | 
			
		||||
            self.minor = match.group('minor')
 | 
			
		||||
            self.sha1 = match.group('sha1')
 | 
			
		||||
            self.rc = match.group('rc')
 | 
			
		||||
            groups = match.groupdict()
 | 
			
		||||
            self.version_number = int(groups['version'])
 | 
			
		||||
            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')
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return '{} {}'.format(self.release, self.version)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user