# vim:ft=zsh ## This is a post-update hook for pkg (a vcs-home implementation). ## It includes configs provided by other packages ## and sets some more static parameters mkdir -p $HOME/var/cache/zsh mkdir -p $PDIR/zsh/provided rm -f $HOME/var/cache/zsh/compdump echo -n > $PDIR/zsh/provided/includes echo -n > $PDIR/zsh/provided/env typeset -a futurepath for inc in $PDIR/*/provides/zsh/{functions,completions}(N); { futurepath+=${inc/$HOME/\$HOME} } if [[ -n $futurepath ]] { echo "fpath=($futurepath \$fpath)" > $PDIR/zsh/provided/env } for inc in $PDIR/*/provides/zsh/functions(*N:t); { echo "autoload $inc" >> $PDIR/zsh/provided/includes } for snippet in $PDIR/*/provides/zsh/*(.N); { echo "source ${snippet/$HOME/\$HOME}" >> $PDIR/zsh/provided/includes } # A machine rarely gets a new CPU, so why not do this here... echo export MAKEFLAGS=\ \"j$(grep -c '^processor' /proc/cpuinfo)\" >> $PDIR/zsh/provided/env cd $PDIR/zsh/etc zcompile functions.zwc functions/* zcompile completions.zwc completions/* # Preserve old history if [[ ! -e ~/var/cache/zsh/history ]] { cp ~/.histfile ~/var/cache/zsh/history }