summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-08-19 14:59:04 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-08-19 14:59:04 -0500
commitae6f94f8a910b91433a5133a96bfaae40ee34b4c (patch)
tree4de4192d30a02e80d14f0535ffd5e8fc74077958 /scripts
parentf86cc376d4c8792be7364b8a718928b3ab2caacb (diff)
downloadvyos-1x-ae6f94f8a910b91433a5133a96bfaae40ee34b4c.tar.gz
vyos-1x-ae6f94f8a910b91433a5133a96bfaae40ee34b4c.zip
T3768: Revert "xml: T1962: Add script to process syntaxVersion tags during build"
This reverts commit 0ecc2c26f7ac939e4e23c14f5027ac7592c25761.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-component-versions47
1 files changed, 0 insertions, 47 deletions
diff --git a/scripts/build-component-versions b/scripts/build-component-versions
deleted file mode 100755
index 5362dbdd4..000000000
--- a/scripts/build-component-versions
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-import os
-import argparse
-import json
-
-from lxml import etree as ET
-
-parser = argparse.ArgumentParser()
-parser.add_argument('INPUT_DIR', type=str,
- help="Directory containing XML interface definition files")
-parser.add_argument('OUTPUT_DIR', type=str,
- help="Output directory for JSON file")
-
-args = parser.parse_args()
-
-input_dir = args.INPUT_DIR
-output_dir = args.OUTPUT_DIR
-
-version_dict = {}
-
-for filename in os.listdir(input_dir):
- filepath = os.path.join(input_dir, filename)
- print(filepath)
- try:
- xml = ET.parse(filepath)
- except Exception as e:
- print("Failed to load interface definition file {0}".format(filename))
- print(e)
- sys.exit(1)
-
- root = xml.getroot()
- version_data = root.iterfind("syntaxVersion")
- for ver in version_data:
- component = ver.get("component")
- version = int(ver.get("version"))
-
- v = version_dict.get(component)
- if v is None:
- version_dict[component] = version
- elif version > v:
- version_dict[component] = version
-
-out_file = os.path.join(output_dir, 'component-versions.json')
-with open(out_file, 'w') as f:
- json.dump(version_dict, f, indent=4, sort_keys=True)