Make sure fixup always completes
[girocco.git] / updatecheck.sh
blobb05555f992fabc3cbc544e1513b0e979eba6360f
1 #!/bin/bash
3 if [ -e /tmp/gitupdatelock ]; then
4 echo "Locked!" >&2
5 exit 1
6 fi
7 touch /tmp/gitupdatelock
9 cd /srv/git
10 find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' |
11 while read dir; do
12 if [ -e "$dir"/.nofetch ]; then
13 (cd "$dir/objects" && [ "$(ls ?? 2>/dev/null)" ] && GIT_DIR=".." git repack -a -d)
14 GIT_DIR="$dir" git update-server-info
15 else
16 /home/repo/repomgr/update.sh "${dir%.git}"
18 done 2>&1 | grep -v '^Pack.*created\.$'
20 rm /tmp/gitupdatelock