summaryrefslogtreecommitdiffstats
path: root/debian/rules.d/scripts/mod/gendef.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
commit08b74a000942a380fe028845f92cd3a0dee827d5 (patch)
treeaa78b4e12607c3e1fcce8d5cc42df4330792f118 /debian/rules.d/scripts/mod/gendef.py
parentAdding upstream version 4.19.249. (diff)
downloadlinux-08b74a000942a380fe028845f92cd3a0dee827d5.tar.xz
linux-08b74a000942a380fe028845f92cd3a0dee827d5.zip
Adding debian version 4.19.249-2.debian/4.19.249-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules.d/scripts/mod/gendef.py')
-rwxr-xr-xdebian/rules.d/scripts/mod/gendef.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/rules.d/scripts/mod/gendef.py b/debian/rules.d/scripts/mod/gendef.py
new file mode 100755
index 000000000..55d3fc60e
--- /dev/null
+++ b/debian/rules.d/scripts/mod/gendef.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python3
+import re
+import sys
+
+for line in open(sys.argv[1]):
+ match = re.search(r'getopt\(argc, argv, "([\w:]*?)"\)', line)
+ if match:
+ options = match.group(1)
+ break
+else:
+ raise RuntimeError
+
+print('#define GETOPT_OPTIONS "%s"' % options)
+
+print('#define GETOPT_CASE', end=' ')
+for c in options:
+ if c == ':' or c == 'T':
+ continue
+ print("case '%c':" % c, end=' ')
+print()