summaryrefslogtreecommitdiff
path: root/scripts/transclude-template
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/transclude-template')
-rwxr-xr-xscripts/transclude-template7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/transclude-template b/scripts/transclude-template
index 5c6668a84..932f91351 100755
--- a/scripts/transclude-template
+++ b/scripts/transclude-template
@@ -4,7 +4,7 @@
# interpret #include statements to include nested XML fragments and
# snippets in documents.
#
-# Copyright (C) 2021 VyOS maintainers and contributors
+# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -23,6 +23,7 @@
import os
import re
import sys
+import glob
regexp = re.compile(r'^ *#include <(.+)>$')
@@ -34,7 +35,9 @@ def parse_file(filename):
if line:
result = regexp.match(line)
if result:
- lines += parse_file(os.path.join(directory, result.group(1)))
+ res = os.path.join(directory, result.group(1))
+ for g in sorted(glob.glob(res)):
+ lines += parse_file(g)
else:
lines += line
else: