The new script is going to be more general and the original
functionality can be requested by "cpu-cpuid.py convert".
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
props[name] = value
-for path in sys.argv[1:]:
+def convert(path):
props, cpuid = parseFeatureWords(path)
for feature in cpuidMap:
"id": "model-expansion"},
f, indent = 2, separators = (',', ': '))
f.write("\n")
+
+
+if len(sys.argv) < 3:
+ print "Usage: %s convert json_file..." % sys.argv[0]
+ sys.exit(1)
+
+action = sys.argv[1]
+args = sys.argv[2:]
+
+if action == "convert":
+ for path in args:
+ convert(path)
+else:
+ print "Unknown action: " + action
+ sys.exit(1)
if [[ -s $fname.json ]]; then
echo $fname.json
if ! grep -q model-expansion $fname.json; then
- $(dirname $0)/cpu-convert.py $fname.json
+ $(dirname $0)/cpu-cpuid.py convert $fname.json
fi
else
rm $fname.json