summaryrefslogtreecommitdiff
path: root/hooks/post-update
blob: 97a89dd01d09c54a2ede3b4566f9224fd90954c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# vim:ft=zsh
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); {
	inc=${inc/$HOME/\$HOME}
	futurepath+=$inc
}
if [[ -n $futurepath ]] {
	echo "fpath=($futurepath" '$fpath)' > $PDIR/zsh/provided/env
}
for inc in $PDIR/*/provides/zsh/functions(N); {
	echo "autoload ${inc:t}" >> $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 '^processor' /proc/cpuinfo|wc -l) + 1 ))\" >> $PDIR/zsh/provided/env

cd $PDIR/zsh/etc
zcompile functions.zwc functions/*
zcompile completions.zwc completions/*