File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,37 @@ def clang_image(images):
2525 return None
2626
2727
28+ # Check that `image` is at least as new as one of the images
29+ # in the `versions` list.
30+ def image_at_least (image , versions ):
31+ # Split the image into the name and optional version number
32+ parts = image .split ('@' )
33+ iname = parts [0 ]
34+ if len (parts ) == 2 :
35+ iversion = int (parts [1 ].replace ('.' , '' ))
36+ else :
37+ iversion = None
38+
39+ for version in versions :
40+ vname , vver = version .split ('@' )
41+
42+ # If the names don't match continue
43+ if iname != vname :
44+ continue
45+
46+ # If the input image has no version it's implicitly the latest, so
47+ # assume it's sufficiently new.
48+ if iversion is None :
49+ return True
50+
51+ # Compare the version numbers
52+ vver = int (vver .replace ('.' , '' ))
53+ if iversion >= vver :
54+ return True
55+
56+ return False
57+
58+
2859def qemu_coverage (args , suite = None ):
2960 images = std_images (args )
3061 if suite is None :
You can’t perform that action at this time.
0 commit comments