aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-10-04 16:48:54 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-10-04 20:14:05 +0300
commitdb3c9c8d3b5903b353bca2fa349d3386c1f68096 (patch)
tree53775743b0f1ec64c271175f595d06502ea1bcaf /scripts
parentRemove outparam section in Configuration parse (diff)
downloadsmolbote-db3c9c8d3b5903b353bca2fa349d3386c1f68096.tar.xz
Remove Breakpad optdepend
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen-crashhandler-default-go.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/gen-crashhandler-default-go.py b/scripts/gen-crashhandler-default-go.py
deleted file mode 100755
index e080ed9..0000000
--- a/scripts/gen-crashhandler-default-go.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-import argparse
-import kconfiglib
-import re
-
-def findItem(node, name):
- while node:
- if isinstance(node.item, kconfiglib.Symbol):
- if node.item.name == name:
- return node.item.str_value
-
- if node.list:
- found = findItem(node.list, name)
- if found is not None:
- return found
-
- node = node.next
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser()
- parser.add_argument("--kconfig", nargs="?", default="Kconfig", help="Top-level Kconfig")
- parser.add_argument("--dotconfig", nargs="?", help=".config")
- parser.add_argument("--input", type=argparse.FileType('r'), help="default.go.in")
- parser.add_argument("--output", type=argparse.FileType('w'), default=sys.stdout, help="Output location")
- args = parser.parse_args()
-
- kconf = kconfiglib.Kconfig(args.kconfig)
- if args.dotconfig is not None:
- kconf.load_config(args.dotconfig)
-
- marker = re.compile('.+(@(\w+)@)')
- for line in args.input:
- found = marker.match(line)
- if found:
- print(str.replace(line, found.group(1), findItem(kconf.top_node, found.group(2))), end='', file=args.output)
- else:
- print(line, end='', file=args.output)
-