initial commit
imported from https://salsa.debian.org/kernel-team/linux.git commit 9d5cc9d9d6501d7f1dd7e194d4b245bd0b6c6a22 version 6.11.4-1
This commit is contained in:
20
debian/rules.d/scripts/mod/gendef.py
vendored
Executable file
20
debian/rules.d/scripts/mod/gendef.py
vendored
Executable file
@@ -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()
|
Reference in New Issue
Block a user