6 # Check that the sorting order is preserved in pci.ids
12 file = open("pci.ids")
13 hexnum = '([0-9a-fA-F]{4})'
18 m = re.match(hexnum + '\s+' + desc, line)
20 new_id = int('0x' + m.group (1), 16)
21 if new_id <= vendor_id:
22 print ("%d: Vendor ID (0x%04x) is less that previous ID (0x%04x)" %
23 (lineno, new_id, vendor_id))
29 m = re.match('\t' + hexnum + '\s+' + desc, line)
31 new_id = int('0x' + m.group (1), 16)
32 if new_id <= device_id:
33 print ("%d: Device ID (0x%04x) is less that previous ID (0x%04x)" %
34 (lineno, new_id, device_id))