=== modified file 'sbin/zsv.exec' --- sbin/zsv.exec 2014-02-28 22:45:50 +0000 +++ sbin/zsv.exec 2014-02-28 20:03:32 +0000 @@ -7,26 +7,3 @@ zsv_mode=$0:t zsv_dir=$1:a:h fi - -autoload -Uz zsv_config; zsv_config -zsv_parse -zsv_eval - -(($flags[X])) && set -x - -if [[ -n $zsv_hooks[$zsv_mode] ]]; then - for hook in $=zsv_hooks; do - (($+functions[$hook])) || autoload -Uz $hook - $hook - done -fi - -if (($+handler[$mode])); then - runf=$handler[$mode] -else - runf=$zsv_default_handler[$mode] ]] -fi - -[[ -z $runf ]] && exit 0 -(($+functions[$runf])) || autoload -Uz $runf -$runf === modified file 'sbin/zsvcheck' --- sbin/zsvcheck 2014-02-28 22:45:50 +0000 +++ sbin/zsvcheck 2014-02-17 07:41:00 +0000 @@ -1,7 +1,7 @@ #!/bin/zsh # vim: ft=zsh noet ts=4 sts=4 sw=4 -typeset -g f_run f_log f_check +typeset -g runf logf checkf autoload -Uz zsv_config zsv_config zsv_parse === modified file 'sbin/zsvgen' --- sbin/zsvgen 2014-02-28 22:45:50 +0000 +++ sbin/zsvgen 2014-02-28 19:28:53 +0000 @@ -32,7 +32,7 @@ esac done -typeset -g f_run f_log f_check +typeset -g runf logf checkf typeset -A remove autoload -Uz zsv_config @@ -92,18 +92,14 @@ fi # run - for f in run check u d o p c h a i q 1 2 t k x; do - if zsv_has_handler $f; then - [[ -L $zsv_dir/$f ]] && rm $zsv_dir/$f - ln -s ${commands[zsv.exec]} $zsv_dir/$f - fi - done + [[ -L $zsv_dir/run ]] && rm $zsv_dir/run + ln -s ${commands[zsv.run]} $zsv_dir/run # log if [[ $logf != '-' ]]; then mkdir -p $zsv_dir/log [[ -L $zsv_dir/log/run ]] && rm $zsv_dir/log/run - ln -s ${commands[zsv.exec]} $zsv_dir/log/run + ln -s ${commands[zsv.log.run]} $zsv_dir/log/run elif [[ -x $zsv_dir/log/run ]]; then rm -f $zsv_dir/log/run [[ -p $zsv_dir/log/supervise/control ]] && \ === removed file 'zsh-functions/zsv_add_hook' --- zsh-functions/zsv_add_hook 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_add_hook 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -if [[ -n $zsv_hooks[$1] ]]; then - $zsv_hooks[$1]+=' '$2 -else - $zsv_hooks[$1]=$2 -fi -# vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_config' --- zsh-functions/zsv_config 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_config 2014-02-14 19:20:50 +0000 @@ -1,5 +1,5 @@ +typeset -g runf logf checkf typeset -g -a run args zsv_hooks -typeset -g -A zsv_default_handler handler zsv_hooks if ! (($+zsv_dir)); then zsv_dir=/run/zsv/foo @@ -9,13 +9,11 @@ zsv_hooks=( zsv_apply_flags ) -zsv_default_handler[run]=zsv_generic -zsv_default_handler[log]=zsv_logger -zsv_default_handler[cond]=check -zsv_default_handlerlags=E - [[ -e /etc/zsvrc ]] && source /etc/zsvrc : ${zsv_svtab:=/etc/svtab} +: ${zsv_default_flags=E} +: ${zsv_default_runf=zsv_generic} +: ${zsv_default_logf=zsv_logger} # autoload all zsv_ functions local -a func_files === modified file 'zsh-functions/zsv_defaults_rfkill' --- zsh-functions/zsv_defaults_rfkill 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_defaults_rfkill 2014-02-14 19:26:05 +0000 @@ -1,3 +1,3 @@ run=( rfkill event ) -runf zsv_run_event_reader +runf=zsv_run_event_reader # vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_eval' --- zsh-functions/zsv_eval 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_eval 2014-02-18 03:32:51 +0000 @@ -1,6 +1,6 @@ unset flags -typeset -g -A flags handler -typeset -g f_run f_log f_check +typeset -g -A flags +typeset -g runf logf checkf if (( $# )); then zsv_setdirs $1 @@ -14,20 +14,15 @@ done zsv_dotnames=( ${(s:.:)zsv_name} ) -#f_run=${zsv_default_runf} -#f_log=${zsv_default_logf} -# f_cond=check +runf=${zsv_default_runf} +logf=${zsv_default_logf} +checkf=check check() { true } -runf() { handler[run]=$1 } -logf() { handler[log]=$1 } -condf() { handler[cond]=$1 } -checkf() { handler[check]=$1 } - if (($+functions[zsv_run_${zsv_name%%.*}])); then - runf zsv_run_${zsv_name%%.*} + runf=zsv_run_${zsv_name%%.*} fi if (($+functions[zsv_defaults_${zsv_name%%.*}])); then zsv_defaults_${zsv_name%%.*} === removed file 'zsh-functions/zsv_has_handler' --- zsh-functions/zsv_has_handler 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_has_handler 1970-01-01 00:00:00 +0000 @@ -1,16 +0,0 @@ -local mode=${1:-$zsv_mode} - -if [[ $mode != (run|log) ]]; then - [[ -n $zsv_hooks[$mode] ]] && return 0 -fi - -if (($+handler[$mode])); then - [[ -n $handler[$mode] ]] - return $? -fi - -if (($+zsv_default_handler[$mode])); then - [[ -n $zsv_default_handler[$mode] ]] - return $? -fi -# vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_hook_cgroups' --- zsh-functions/zsv_hook_cgroups 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_hook_cgroups 2014-02-25 21:26:10 +0000 @@ -1,4 +1,3 @@ if [[ -f /proc/cgroups && -d /sys/fs/cgroup ]]; then - zsv_add_hook run zsv_set_cgroup + zsv_hooks+=zsv_set_cgroup fi -# vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_parse' --- zsh-functions/zsv_parse 2014-02-28 22:45:50 +0000 +++ zsh-functions/zsv_parse 2014-02-18 04:10:40 +0000 @@ -1,5 +1,5 @@ typeset -g -a svtab -typeset -g -A svtab_flags svtab_sh +typeset -g -A svtab_flags svtab_runf svtab_logf svtab_sh typeset -g zsv_flags zsv_sh local name flags sh local -a split