diff --git a/scripts/jw-pkg b/scripts/jw-pkg index b95d0181..7dab15f3 100644 --- a/scripts/jw-pkg +++ b/scripts/jw-pkg @@ -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