mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
jw-pkg: Add command line to warning about missing templates
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
6ca1f25a31
commit
d56c3b98c5
1 changed files with 9 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue