Announce: typofix
[git/spearce.git] / Dothem
blob89ae7a3b78fa535f9d66e8e512c22ea7b16ff6b3
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 if git diff --quiet --exit-code jch next
58 then
59 dotest=
60 else
61 dotest=test
65 dotest=test ;;
66 esac
68 cd "$BUILDBASE/$branch"
69 git checkout "$branch" &&
70 git reset --hard || exit
71 case "$private" in
72 '')
74 ?*)
75 git merge --squash --no-commit "$private" || {
76 echo >&2 "Cannot apply private edition changes"
77 git reset --hard
80 esac &&
82 case "$with_dash" in
84 case "$branch" in
85 master | maint | next | jch)
86 Meta/Make $M -- $J SHELL_PATH=/bin/dash $dotest
88 esac
90 esac &&
92 Meta/Make $M -- $J all &&
93 Meta/Make $M -- $J $dotest &&
94 case "$branch" in
95 master | maint | next )
96 Meta/Make $M -- doc
98 jch )
99 Meta/Make $M -- doc install-doc
102 : ;;
103 esac &&
105 test z$install = znoinstall ||
106 Meta/Make $M -- install
107 } || exit $?
109 git reset --hard
110 ) || break;
112 done