=== modified file 'common.zsh' --- common.zsh 2017-11-14 19:45:25 +0000 +++ common.zsh 2017-11-14 09:47:48 +0000 @@ -2,12 +2,10 @@ setopt no_unset warn_create_global extended_glob set -x -typeset -g DO FILE BASE OUT FUNCDIR -DO=$0 +typeset -g FILE BASE OUT FILE=$1 BASE=$2 OUT=$3 -FUNCDIR=${0:h:a}/functions # helper that prints out error message and exits die() { @@ -15,15 +13,6 @@ exit 1 } -autoload_functions() { - local f - fpath=( $FUNCDIR $fpath ) - for f in $FUNCDIR/*(.); do - [[ $f:t =~ '^[-_[:alnum:]]*$' ]] || continue - functions[$f:t]='redo-ifchange $FUNCDIR/'$f' && autoload -Uz '$f' && '$f' "$@"' - done -} - decode_args() { typeset -gA args local arg @@ -87,9 +76,9 @@ # to variable ${vars[bar]} of caller # are arguments passed to the dependency function - local name outer inner + local name outer inner indent_prev check_only_prev check_ret local target - local -a new_args run + local -a new_args local -A lift name=$1 @@ -113,13 +102,9 @@ esac shift done - if (($#)); then - run=( "$@" ) - else - run=( redo-ifchange ) - fi + target=${(j::)${(oq)a}}$.name - "$run[@]" meta/$target + redo-ifchange meta/$target if (($#lift)); then # lift %variables from calee to caller @@ -143,7 +128,6 @@ if (($+functions[main])); then redo-ifchange common.zsh || exit $? - autoload_functions decode_args main || exit $? finish === removed file 'default.alpine-base.do' --- default.alpine-base.do 2017-11-14 19:45:25 +0000 +++ default.alpine-base.do 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -#!/bin/zsh -main() { - checkvars arch - defvar release edge - defvar repositories main - -} -. ./common.zsh -# vim: fileencoding=utf8 ft=zsh noet sw=4 ts=4 sts=4 === removed file 'default.download-file.do' --- default.download-file.do 2017-11-14 19:45:25 +0000 +++ default.download-file.do 1970-01-01 00:00:00 +0000 @@ -1,11 +0,0 @@ -#!/bin/zsh -main() { - checkvars url - local scheme rest - scheme=${args[url]%%:*} - rest=${${${args[url]#*:}#/}#/} - args[filename]=${DO:h:a}/downloads/$scheme/${rest:a} - wget --timestamping --force-directories --protocol-directories -P downloads $args[url] -} -. ./common.zsh -# vim: fileencoding=utf8 ft=zsh noet sw=4 ts=4 sts=4 === modified file 'default.tarball-unpacked.do' --- default.tarball-unpacked.do 2017-11-14 19:45:25 +0000 +++ default.tarball-unpacked.do 2017-11-14 09:47:48 +0000 @@ -3,4 +3,3 @@ checkvars tarball } . ./common.zsh -# vim: fileencoding=utf8 ft=zsh noet sw=4 ts=4 sts=4