=== modified file 'sbin/zsv.exec' --- sbin/zsv.exec 2014-06-24 14:08:45 +0000 +++ sbin/zsv.exec 2014-03-01 16:29:46 +0000 @@ -9,7 +9,7 @@ fi autoload -Uz zsv_config; zsv_config -zsv_parse $zsv_dir:t +zsv_parse zsv_eval (( ${flags[X]} )) && set -x === modified file 'zsh-functions/zsv_config' --- zsh-functions/zsv_config 2014-06-24 14:08:45 +0000 +++ zsh-functions/zsv_config 2014-03-05 18:10:44 +0000 @@ -22,7 +22,6 @@ [[ -e /etc/zsvrc ]] && source /etc/zsvrc : ${zsv_svtab:=/etc/svtab} -: ${zsv_svd:=/etc/sv.d} # autoload all zsv_ functions local -a func_files === modified file 'zsh-functions/zsv_parse' --- zsh-functions/zsv_parse 2014-06-24 14:08:45 +0000 +++ zsh-functions/zsv_parse 2014-02-28 22:45:50 +0000 @@ -1,58 +1,29 @@ typeset -g -a svtab -typeset -g -A svtab_flags svtab_sh svtab_src +typeset -g -A svtab_flags svtab_sh typeset -g zsv_flags zsv_sh -local f name flags sh line +local name flags sh local -a split - -# invoked from zsv.exec, don't parse other files unnecessarily -if [[ -n $1 && -e $zsv_svd/$1 ]]; then - svtab=( $1 ) - svtab_src[$1]=$zsv_svd/$1 - svtab_sh[$1]="$(<$zsv_svd/$1)" - line=${${=svtab_sh[$1]}[1]} - if [[ $line == '#flags:'* ]]; then - svtab_flags[$1]=$zsv_default_flags${line#\#flags:} - fi - return 0 -fi - -# read svtab -if [[ -e $zsv_svtab ]]; then - while IFS=: read line; do - [[ $line == '#'* ]] && continue - if [[ $line == [$~IFS]* ]]; then - svtab_sh[$name]+=$'\n'$line +while IFS=: read line; do + [[ $line == '#'* ]] && continue + if [[ $line == [$~IFS]* ]]; then + svtab_sh[$name]+=$'\n'$line + else + split=( ${(s.:.)line} ) + name=$split[1] + if [[ ${line#*:} == :* ]]; then + sh=${line#*::} else - split=( ${(s.:.)line} ) - name=$split[1] - svtab_src[$name]=$zsv_svtab - if [[ ${line#*:} == :* ]]; then - sh=${line#*::} + flags=$split[2] + if (( $#split >= 3 )); then + sh=${${line#*:}#*:} else - flags=$split[2] - if (( $#split >= 3 )); then - sh=${${line#*:}#*:} - else - unset sh - fi + unset sh fi - - svtab+=$name - svtab_flags[$name]=$zsv_default_flags$flags - svtab_sh[$name]=${sh} fi - done <$zsv_svtab -fi -# read all plain files (or symlinks to) in sv.d -for f in $zsv_svd/*(-.); do - name=$f:t - svtab=( $name ) - svtab_src[$name]=$f - svtab_sh[$name]="$(<$f)" - line=${${=svtab_sh[$name]}[1]} - if [[ $line == '#flags:'* ]]; then - svtab_flags[$name]=$zsv_default_flags${line#\#flags:} + svtab+=$name + svtab_flags[$name]=$zsv_default_flags$flags + svtab_sh[$name]=${sh} fi -done +done <$zsv_svtab # vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_write_scriptnames' --- zsh-functions/zsv_write_scriptnames 2014-06-24 14:08:45 +0000 +++ zsh-functions/zsv_write_scriptnames 2014-06-23 14:54:36 +0000 @@ -1,7 +1,6 @@ local -A loaded local ffile fname -# check which autoloadable functions are loaded for ffile in $^fpath/*(.N); do fname=$ffile:t if (($+functions[$fname])) && \ @@ -11,9 +10,7 @@ fi done -# print service's script file, explicit restart files and autoloaded -# functions into restart.files -print -rl - $svtab_src[$zsv_name] $restart_files $loaded >$zsv_dir/restart.files +print -rl - $restart_files $loaded $zsv_svtab >$zsv_dir/restart.files # add the executable to restart.files if [[ $run[1] == /* ]]; then