jobs/README: Update, -clonecheck, +gccheck
[girocco.git] / jobs / gccheck.sh
blob140b4e368eb26dc43787d64511598f2e8bb886f5
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 if [ -e /tmp/gitupdatelock ]; then
6 echo "Locked!" >&2
7 exit 1
8 fi
9 touch /tmp/gitupdatelock
11 rootdir="$cfg_reporoot"
13 repack()
15 dir="$1"
16 progress "+ `date` $dir"
17 # safe pruning: we put all our objects to all forks, then we can
18 # safely get rid of extra ones; repacks in forks will get rid of
19 # the redundant ones again then
20 forkdir="${dir%.git}"
21 if [ -d "$forkdir" ]; then
22 (cd "$forkdir" && get_repo_list_here) |
23 (cd "$dir" && while read fork; do
24 for d in objects/?? objects/pack; do
25 [ "$d" != "objects/??" ] || continue
26 mkdir -p "$rootdir/$forkdir/$fork/$d"
27 ln -f "$d"/* "$rootdir/$forkdir/$fork/$d"
28 done
29 done)
32 git --git-dir="$dir" repack -A -d --window-memory=3G -l -q
33 git --git-dir="$dir" prune
34 git --git-dir="$dir" update-server-info
35 date -R >"$dir/.last_gc"
36 progress "- `date` $dir"
39 cd "$rootdir"
40 get_repo_list_here |
41 while read dir; do
42 repack "$dir"
43 done 2>&1 | grep -v '^Pack.*created\.$'
45 rm /tmp/gitupdatelock