mirroring: add individual foreign vcs mirror control
[girocco.git] / toolbox / update-all-hooks.sh
blob4382dd01648780a2ce8a5a8425ba47e8e2961aa2
1 #!/bin/sh
3 # Update all out-of-date hooks in all current projects
5 set -e
7 . @basedir@/shlib.sh
9 base="$cfg_reporoot"
10 hookbin="$cfg_basedir/hooks"
11 cut -d : -f 1 < "$cfg_chroot/etc/group" | grep -v _repo | \
13 while read proj; do
14 projdir="$base/$proj.git"
15 updates=
16 for hook in post-receive update post-update; do
17 if [ -f "$projdir/hooks/$hook" ]; then
18 if ! cmp -s "$hookbin/$hook" "$projdir/hooks/$hook"; then
19 cat "$hookbin/$hook" > "$projdir/hooks/$hook"
20 updates="$updates $hook"
23 done
24 [ -z "$updates" ] || echo "$proj:$updates"
25 done