mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 02:03:37 +08:00
tools: pylint meson-render-jinja2.py
This commit is contained in:
parent
d853b9be98
commit
2d49429e58
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# pylint: disable=consider-using-with
|
||||
|
||||
import ast
|
||||
import os
|
||||
@ -30,7 +31,7 @@ def render(filename, defines):
|
||||
undefined=jinja2.StrictUndefined)
|
||||
return template.render(defines)
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
defines = parse_config_h(sys.argv[1])
|
||||
defines.update(parse_config_h(sys.argv[2]))
|
||||
output = render(sys.argv[3], defines)
|
||||
@ -38,3 +39,6 @@ if __name__ == '__main__':
|
||||
f.write(output)
|
||||
info = os.stat(sys.argv[3])
|
||||
os.chmod(sys.argv[4], info.st_mode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user