]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
build: tools: keep trailing newline in jinja2 renderer
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Jan 2023 10:13:46 +0000 (11:13 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Jan 2023 10:39:38 +0000 (11:39 +0100)
Otherwise /usr/share/lxc/config/common.conf.d/00-lxcfs.conf
loses its trailing newline

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
tools/meson-render-jinja2.py

index 0f9fc431243006fd45ae597c35b64fa4a5334fcf..c7b6c38863659b97e0684fdf0b98c3771ef5d032 100755 (executable)
@@ -23,7 +23,12 @@ def parse_config_h(filename):
 
 def render(filename, defines):
     text = open(filename).read()
-    template = jinja2.Template(text, trim_blocks=True, undefined=jinja2.StrictUndefined)
+    template = jinja2.Template(
+        text,
+        trim_blocks=True,
+        keep_trailing_newline=True,
+        undefined=jinja2.StrictUndefined,
+    )
     return template.render(defines)
 
 if __name__ == '__main__':