This changes the invocation from
./cpu-gather.sh | ./cpu-parse.sh
to
./cpu-gather.py | ./cpu-parse.sh
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
--- /dev/null
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+
+def main():
+ os.environ["CPU_GATHER_PY"] = "true"
+ subprocess.check_call("./cpu-gather.sh")
+
+
+if __name__ == "__main__":
+ main()
# distro does not provide such package, you can find the sources or binary
# packages at https://www.etallen.com/cpuid.html
+if [ -z "${CPU_GATHER_PY}" ]; then
+ echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instead."
+ exit 1
+fi
+
grep 'model name' /proc/cpuinfo | head -n1
cpuid -1r
#!/bin/bash
# Usage:
-# ./cpu-gather.sh | ./cpu-parse.sh
+# ./cpu-gather.py | ./cpu-parse.sh
data=`cat`