Update Dothem to be more quiet
[git/spearce.git] / Dothem
blobc22a6fa45b248204208b4b99c23b192db2eea629
1 #!/bin/sh
3 : ${J=-j2}
4 : ${BUILDBASE=../buildfarm}
5 : ${branches='next master maint pu jch'}
7 force= with_dash= M= install=
8 while case "$1" in
9 -pedantic) M=$1 ;;
10 -force) force=$1 ;;
11 -dash) with_dash=y ;;
12 -noinstall) install=noinstall ;;
13 *) break ;;
14 esac
16 shift
17 done
18 test -f /bin/dash || with_dash=
20 for branch in $branches
22 echo "** $branch **"
23 revision=$(git show-ref -s --verify "refs/heads/$branch") || {
24 echo "** No $branch"
25 continue
27 test -d "$BUILDBASE/$branch" || {
28 echo "** No $BUILDBASE/$branch"
29 continue
32 private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
33 case $? in 0|1) ;; *) exit $? ;; esac
35 if installed=$($HOME/git-$branch/bin/git version) &&
36 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
37 then
39 elif version=v$(expr "$installed" : \
40 'git version \(.*\)\.rc[0-9]*$')
41 then
42 version="$version"-$(expr "$installed" : \
43 'git version .*\.\(rc[0-9]*\)$')
44 else
45 version=v$(expr "$installed" : 'git version \(.*\)')
46 fi &&
47 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
48 test "z$version" = "z$revision"
49 then
50 echo "* up-to-date version \"$installed\" is already installed from $branch"
51 test -n "$force" || continue
55 case "$branch, $branches " in
56 jch,*' next '*)
57 dotest= ;;
59 dotest=test ;;
60 esac
62 cd "$BUILDBASE/$branch"
63 git checkout "$branch" &&
64 git reset --hard || exit
65 case "$private" in
66 '')
68 ?*)
69 git merge --squash --no-commit "$private" || {
70 echo >&2 "Cannot apply private edition changes"
71 git reset --hard
74 esac &&
76 case "$with_dash" in
78 case "$branch" in
79 master | maint | next | jch)
80 Meta/Make $M -- $J SHELL_PATH=/bin/dash $dotest
82 esac
84 esac &&
86 Meta/Make $M -- $J all &&
87 Meta/Make $M -- $J $dotest &&
88 case "$branch" in
89 master | maint | next )
90 Meta/Make $M -- doc
92 jch )
93 Meta/Make $M -- doc install-doc
96 : ;;
97 esac &&
99 test z$install = znoinstall ||
100 Meta/Make $M -- install
101 } || exit $?
103 git reset --hard
104 ) || break;
106 done