jw-pkg: Add command list-template-output

This should come in handy for removing generated files. Do some
code-cleanup, too.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-11-19 09:55:41 +00:00
commit 0b8dc4bbfd

View file

@ -27,9 +27,11 @@ cat << EOT
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
build-date: show installed jannet packages along with build date
built-today: show installed jannet packages that were built today
build-date: show installed janware packages along with build date
built-today: show installed janware packages built today
list-templates: list templates
list-template-tables: list templates tables
list-template-output: list template output files
compile-templates: compile templates
global options are
@ -199,6 +201,16 @@ cmd_list_template_tables()
done
}
cmd_list_template_output()
{
local re=`echo $template_exts | sed 's/\./\\\\./g; s/^ *//; s/ *$//; s/ */$\\\\|/g; s/\(.*\)/\\\\(\1$\\\\)/'`
local f
list_packages "$@" | xargs -r rpm -ql | sed "/$re/ !d; s/$re//" | while read f; do
[ -f "$f" -o -L "$f" ] || continue
echo $f
done
}
cmd_compile_templates()
{
local ext_from="$template_exts" # TODO: support more than one
@ -293,7 +305,7 @@ esac
shift
done
cmd="$1"
cmd="${1//-/_}"
shift
case $cmd in
@ -346,34 +358,16 @@ list)
list_packages "$@" | xargs -r rpm -q
fi
;;
list-projects)
list_projects)
list_projects "$@"
;;
cpp-glib)
cpp_glib)
sudo rpm -U --replacefiles --replacepkgs --oldpackage \
ftp://dspadm@ftp.jannet.de/pub/packages/linux/suse/10.1/inst-source/rpm/i586/glib2-2.8.5-19.i586.rpm
check_ldconfig "$@"
;;
rpmnew)
cmd_rpmnew "$@"
;;
compile-templates)
cmd_compile_templates "$@"
;;
list-templates)
cmd_list_templates "$@"
;;
list-template-tables)
cmd_list_template_tables "$@"
;;
diff)
cmd_diff "$@"
;;
build-date)
cmd_build_date "$@"
;;
built-today)
cmd_built_today "$@"
compile_templates|list_templates|list_template_tables|list_template_output|diff|build_date|built_today|rpmnew)
cmd_$cmd "$@"
;;
help)
usage 0