jw-pkg: Honour #conf: line at top of template

Up to now, jw-pkg only evaluates config lines at the top of secret-tables. Look
for config patterns at the top of templates, too.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-09-13 10:46:53 +00:00
commit 9b546592e1

View file

@ -339,6 +339,7 @@ cmd_compile_templates()
local owner=$default_owner local owner=$default_owner
local group=$default_group local group=$default_group
local diff="" local diff=""
eval `sed "/$conf_patt/ !d; s/$conf_patt//" $f`
eval `sed "/$conf_patt/ !d; s/$conf_patt//" $table` eval `sed "/$conf_patt/ !d; s/$conf_patt//" $table`
sed 's|^[ ]*#.*||; s|/|\\/|g; s|\([^ =]\+\)[ =]\+\(.*\)|s/\1/\2/g|' $table | sed -f - $f > $tmp sed 's|^[ ]*#.*||; s|/|\\/|g; s|\([^ =]\+\)[ =]\+\(.*\)|s/\1/\2/g|' $table | sed -f - $f > $tmp
chmod $mode $tmp chmod $mode $tmp