Systemd/src/basic/generate-gperfs.py
Zbigniew Jędrzejewski-Szmek 6b0c49e036 Mark python scripts executable
Since all our python scripts have a proper python3 shebang, there is no benefit
to letting meson autodetect them. On linux, meson will just uses exec(), so the
shebang is used anyway. The only difference should be in how meson reports the
script and that the detection won't fail for (most likely misconfigured)
non-UTF8 locales.

Closes #5855.
2017-05-07 20:16:47 -04:00

17 lines
297 B
Python
Executable file

#!/usr/bin/env python3
"""Generate %-from-name.gperf from %-list.txt
"""
import sys
name, prefix, input = sys.argv[1:]
print("""\
struct {}_name {{ const char* name; int id; }};
%null-strings
%%""".format(name))
for line in open(input):
print("{0}, {1}{0}".format(line.rstrip(), prefix))