]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
setup-app-layer: set copyright year to current year
authorJason Ish <jason.ish@oisf.net>
Thu, 17 Nov 2022 22:27:29 +0000 (16:27 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 6 Dec 2022 13:09:10 +0000 (14:09 +0100)
Ticket: 4939

scripts/setup-app-layer.py

index 920ddf796053af8415ca7532ca7ab56c56197160..80847a7320aae765a885ac4b3936d35d64d31669 100755 (executable)
@@ -8,6 +8,9 @@ import os.path
 import argparse
 import io
 import re
+import datetime
+
+YEAR = datetime.date.today().year
 
 class SetupError(Exception):
     """Functions in this script can raise this error which will cause the
@@ -39,7 +42,10 @@ def common_copy_templates(proto, pairs, replacements=()):
         with open(src) as template_in:
             skip = False
             for line in template_in:
-                if line.find("TEMPLATE_START_REMOVE") > -1:
+                if line.find("/* Copyright") > -1:
+                    output.write("/* Copyright (C) {} Open Information Security Foundation\n".format(YEAR))
+                    continue
+                elif line.find("TEMPLATE_START_REMOVE") > -1:
                     skip = True
                     continue
                 elif line.find("TEMPLATE_END_REMOVE") > -1: