cpu-data.py: Automatically adjust command line for kcpuid

kcpuid does not have a "-1" flag.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-27 10:25:03 +02:00 committed by Michal Privoznik
parent 95a89ed012
commit d1873e03b4

View File

@ -116,7 +116,7 @@ def gather_cpuid_leaves(args):
cpuid = args.path_to_cpuid or "cpuid"
try:
output = subprocess.check_output(
[cpuid, "-1r"],
[cpuid, "-r" if "kcpuid" in cpuid else "-1r"],
universal_newlines=True)
except FileNotFoundError as e:
exit("Error: '{}' not found.\n'cpuid' can be usually found in a "