mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
jw-pkg compile-templates: Support options -ogm
Make jw-pkg compile-templates support options -o owner, -g group and -m mode Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
9163dd51cd
commit
2e42b36728
1 changed files with 34 additions and 20 deletions
|
|
@ -46,23 +46,6 @@ EOT
|
|||
[ "$1" ] && exit $1
|
||||
}
|
||||
|
||||
get_opts()
|
||||
{
|
||||
set -- `getopt $opts $*`
|
||||
while [ "$1" != -- ] ; do
|
||||
case "$1" in
|
||||
-v)
|
||||
opt_verbose=true
|
||||
;;
|
||||
*)
|
||||
eusage
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
shift
|
||||
}
|
||||
|
||||
create_ldconfig_state()
|
||||
{
|
||||
echo "=== automatically created by $myname update script"
|
||||
|
|
@ -185,9 +168,29 @@ cmd_compile_templates()
|
|||
local mode=600
|
||||
local conf_patt="^[ ]*# *conf:"
|
||||
|
||||
# TODO: allow default target file attributes to be specified in options
|
||||
umask 0077
|
||||
|
||||
while [ ${1:0:1} = '-' ]; do
|
||||
case "$1" in
|
||||
-o)
|
||||
owner="$2"
|
||||
shift
|
||||
;;
|
||||
-m)
|
||||
mode="$2"
|
||||
shift
|
||||
;;
|
||||
-g)
|
||||
group="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
local f
|
||||
cmd_list_templates "$@" | while read f; do
|
||||
local base=`echo $f | sed "s/$ext_from_re$//"`
|
||||
|
|
@ -227,9 +230,21 @@ longname=$0
|
|||
opts="v"
|
||||
template_exts=".jw-tmpl"
|
||||
|
||||
while [ ${1:0:1} = '-' ]; do
|
||||
case "$1" in
|
||||
-v)
|
||||
opt_verbose=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
cmd="$1"
|
||||
shift
|
||||
get_opts $*
|
||||
|
||||
case $cmd in
|
||||
|
||||
|
|
@ -313,5 +328,4 @@ help)
|
|||
*)
|
||||
usage 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue