Dothem update
[git/spearce.git] / Dothem
blob6598517b2a242b01dbc400906e452bda7efaefe8
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
54 echo "** $branch" &&
57 case "$branch, $branches " in
58 jch,*' next '*)
59 dotest= ;;
61 dotest=test ;;
62 esac
64 cd "$BUILDBASE/$branch"
65 git checkout "$branch" &&
66 git reset --hard || exit
67 case "$private" in
68 '')
70 ?*)
71 git merge --squash --no-commit "$private" || {
72 echo >&2 "Cannot apply private edition changes"
73 git reset --hard
76 esac &&
78 case "$with_dash" in
80 case "$branch" in
81 master | maint | next | jch)
82 Meta/Make $M -- $J SHELL_PATH=/bin/dash $dotest
84 esac
86 esac &&
88 Meta/Make $M -- $J all &&
89 Meta/Make $M -- $J $dotest &&
90 case "$branch" in
91 master | maint | next )
92 Meta/Make $M -- doc
94 jch )
95 Meta/Make $M -- doc install-doc
98 : ;;
99 esac &&
101 test z$install = znoinstall ||
102 Meta/Make $M -- install
103 } || exit $?
105 git reset --hard
106 ) || break;
108 done