daemons/gc,update: Nicer progress prints
[girocco/susan.git] / daemons / update.sh
blob346d78e1cd669897d3472391f67e4e0f0ddd8efc
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 set -e
7 proj="$1"
8 cd "$cfg_reporoot/$proj.git"
10 progress "+ [$proj] update (`date`)"
12 bang_setup
13 bang_once=1
14 bang_action="update"
16 url="$(config_get baseurl)"
17 mail="$(config_get owner)"
19 case "$url" in
20 svn://*)
21 GIT_DIR=. bang git svn fetch
22 GIT_DIR=. bang git fetch
25 bang git remote update
26 bang git remote prune origin
28 esac
30 bang git update-server-info
31 bang config_set lastrefresh "$(date -R)"
33 if [ -e .banged ]; then
34 echo "$proj update succeeded - failure recovery" | mail -s "[$cfg_name] $proj update succeeded" "$mail,$cfg_admin"
35 rm .banged
38 progress "- [$proj] update (`date`)"