jw-pkg: Add command list-template-tables

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-11-11 12:48:07 +00:00
commit a836719a51

View file

@ -150,6 +150,7 @@ cmd_list_templates()
{
local ext_from="$template_exts" # TODO: support more than one
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
local f
list_packages "$@" | xargs -r rpm -ql | while read f; do
[ -f "$f" ] || continue
echo $f | grep -q "$ext_from_re$" || continue
@ -157,12 +158,25 @@ cmd_list_templates()
done
}
cmd_list_template_tables()
{
local ext_from="$table_exts"
local e f
list_packages "$@" | xargs -r rpm -ql | while read f; do
[ -f "$f" -o -L "$f" ] || continue
for e in $ext_from; do
[ -f "${f%.*}$e" ] || continue
echo $f
done
done
}
cmd_compile_templates()
{
local ext_from="$template_exts" # TODO: support more than one
local ext_from_re=`echo $template_exts | sed 's/\./\\./g'`
local ext_to=""
local ext_tables=".jw-secret .jw-vars"
local ext_tables="$table_exts"
local group=root
local owner=root
local mode=600
@ -228,6 +242,7 @@ cmd_built_today()
myname=`basename $0`
longname=$0
opts="v"
table_exts=".jw-secret .jw-vars"
template_exts=".jw-tmpl"
while [ ${1:0:1} = '-' ]; do
@ -313,6 +328,9 @@ compile-templates)
list-templates)
cmd_list_templates "$@"
;;
list-template-tables)
cmd_list_template_tables "$@"
;;
diff)
cmd_diff "$@"
;;