[libvirt PATCH 08/11] systemd: Allow comments at the top of units

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently the script will reject any type of contents outside
of a section, but we want to be able to have some useful
comments at the top of each file to help users understand how
they are processed.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 scripts/merge-systemd-units.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/merge-systemd-units.py b/scripts/merge-systemd-units.py
index 30e8757544..869d857f1d 100755
--- a/scripts/merge-systemd-units.py
+++ b/scripts/merge-systemd-units.py
@@ -24,6 +24,11 @@ def parse_unit(unit_path):
             if line == "":
                 continue
 
+            # Comments at the very top of the file, outside of any
+            # section, are allowed and will not show up in the output
+            if line[0] == "#" and current_section == "[Invalid]":
+                continue
+
             if line[0] == "[" and line[-1] == "]":
                 if line not in SECTIONS:
                     print("Unknown section {}".format(line))
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux