mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-27 15:33:55 +01:00
jw-pkg: Add command list-template-tables
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
2e42b36728
commit
a836719a51
1 changed files with 19 additions and 1 deletions
|
|
@ -150,6 +150,7 @@ cmd_list_templates()
|
||||||
{
|
{
|
||||||
local ext_from="$template_exts" # TODO: support more than one
|
local ext_from="$template_exts" # TODO: support more than one
|
||||||
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
|
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
|
||||||
|
local f
|
||||||
list_packages "$@" | xargs -r rpm -ql | while read f; do
|
list_packages "$@" | xargs -r rpm -ql | while read f; do
|
||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
echo $f | grep -q "$ext_from_re$" || continue
|
echo $f | grep -q "$ext_from_re$" || continue
|
||||||
|
|
@ -157,12 +158,25 @@ cmd_list_templates()
|
||||||
done
|
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()
|
cmd_compile_templates()
|
||||||
{
|
{
|
||||||
local ext_from="$template_exts" # TODO: support more than one
|
local ext_from="$template_exts" # TODO: support more than one
|
||||||
local ext_from_re=`echo $template_exts | sed 's/\./\\./g'`
|
local ext_from_re=`echo $template_exts | sed 's/\./\\./g'`
|
||||||
local ext_to=""
|
local ext_to=""
|
||||||
local ext_tables=".jw-secret .jw-vars"
|
local ext_tables="$table_exts"
|
||||||
local group=root
|
local group=root
|
||||||
local owner=root
|
local owner=root
|
||||||
local mode=600
|
local mode=600
|
||||||
|
|
@ -228,6 +242,7 @@ cmd_built_today()
|
||||||
myname=`basename $0`
|
myname=`basename $0`
|
||||||
longname=$0
|
longname=$0
|
||||||
opts="v"
|
opts="v"
|
||||||
|
table_exts=".jw-secret .jw-vars"
|
||||||
template_exts=".jw-tmpl"
|
template_exts=".jw-tmpl"
|
||||||
|
|
||||||
while [ ${1:0:1} = '-' ]; do
|
while [ ${1:0:1} = '-' ]; do
|
||||||
|
|
@ -313,6 +328,9 @@ compile-templates)
|
||||||
list-templates)
|
list-templates)
|
||||||
cmd_list_templates "$@"
|
cmd_list_templates "$@"
|
||||||
;;
|
;;
|
||||||
|
list-template-tables)
|
||||||
|
cmd_list_template_tables "$@"
|
||||||
|
;;
|
||||||
diff)
|
diff)
|
||||||
cmd_diff "$@"
|
cmd_diff "$@"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue