From d56c3b98c5f8fcbc7e92969cb7a72d05ff64463c Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 12 Nov 2018 12:54:52 +0000 Subject: [PATCH] jw-pkg: Add command line to warning about missing templates Signed-off-by: Jan Lindemann --- scripts/jw-pkg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/jw-pkg b/scripts/jw-pkg index fb2ee14a..ca35f928 100644 --- a/scripts/jw-pkg +++ b/scripts/jw-pkg @@ -181,6 +181,7 @@ cmd_compile_templates() local owner=root local mode=600 local conf_patt="^[ ]*# *conf:" + local missing_table=0 umask 0077 @@ -206,7 +207,7 @@ cmd_compile_templates() done local f - cmd_list_templates "$@" | while read f; do + while read f; do local base=`echo $f | sed "s/$ext_from_re$//"` local to=$base$ext_to local table="" @@ -217,6 +218,7 @@ cmd_compile_templates() done [ -f $table ] || { echo "WARNING: No key-value table found for template $f, not compiling." >&2 + ((missing_table++)) continue } # TODO: use mktemp -d and keep temporary files in read-only dir @@ -228,7 +230,11 @@ cmd_compile_templates() chown $owner $tmp chgrp $group $tmp mv $tmp $to - done + done <<< $(cmd_list_templates "$@") + + if [ "$missing_table" != 0 ]; then + echo "WARNING: $missing_table missing tables found. You might want to add them and run sudo $cmdline again." + fi } cmd_built_today() @@ -239,6 +245,7 @@ cmd_built_today() # ----- here we go +cmdline="$0 $@" myname=`basename $0` longname=$0 opts="v"