scripts: purge use of test '-a' and '-o' ops and clean up
[girocco.git] / toolbox / make-all-gc-eligible.sh
blob7fafe1c3e64539ff77d37a014b5d2e11736c0670
1 #!/bin/sh
3 # Unset gitweb.lastreceive in all projects so that the next time
4 # each project reaches its gc interval it will run gc
6 set -e
8 . @basedir@/shlib.sh
10 umask 002
12 base="$cfg_reporoot"
13 cut -d : -f 1 <"$cfg_chroot/etc/group" | grep -v "^_repo" |
15 count=0
16 while read proj; do
17 projdir="$base/$proj.git"
18 if git --git-dir="$projdir" config --unset gitweb.lastreceive 2>/dev/null; then
19 count=$(( $count + 1 ))
20 if [ $(( $count % 10 )) = 0 ]; then
21 printf '%s ' $count
24 done
25 if [ $(( $count % 10 )) != 0 ]; then
26 printf '%s ' $count
28 printf '%s\n' 'done'