Make: set ASCIIDOC_NO_ROFF unconditionally for now
[git] / Dothem
1 #!/bin/sh
2
3 : ${J=-j2}
4 : ${BUILDBASE=../buildfarm}
5 : ${branches='next master maint pu jch'}
6
7 force= with_dash= M= install= nodoc=
8 while   case "$1" in
9         -pedantic) M=$1 ;;
10         -force) force=$1 ;;
11         -dash) with_dash=y ;;
12         -noinstall) install=noinstall ;;
13         -nodoc) nodoc=y ;;
14         *) break ;;
15         esac
16 do
17         shift
18 done
19 test -f /bin/dash || with_dash=
20
21 for branch in $branches
22 do
23         echo "** $branch **"
24         revision=$(git show-ref -s --verify "refs/heads/$branch") || {
25                 echo "** No $branch"
26                 continue
27         }
28         test -d "$BUILDBASE/$branch" || {
29                 echo "** No $BUILDBASE/$branch"
30                 continue
31         }
32
33         private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
34         case $? in 0|1) ;; *) exit $? ;; esac
35
36         if      installed=$($HOME/git-$branch/bin/git version) &&
37                 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
38                 then
39                         :
40                 elif version=v$(expr "$installed" : \
41                                 'git version \(.*\)\.rc[0-9]*$')
42                 then
43                         version="$version"-$(expr "$installed" : \
44                                 'git version .*\.\(rc[0-9]*\)$')
45                 else
46                         version=v$(expr "$installed" : 'git version \(.*\)')
47                 fi &&
48                 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
49                 test "z$version" = "z$revision"
50         then
51                 echo "* up-to-date version \"$installed\" is already installed from $branch"
52                 test -n "$force" || continue
53         fi
54
55         (
56                 case "$branch, $branches " in
57                 jch,*' next '*)
58                         if git diff --quiet --exit-code jch next
59                         then
60                                 dotest=
61                         else
62                                 dotest=test
63                         fi
64                         ;;
65                 *)
66                         dotest=test ;;
67                 esac
68
69                 cd "$BUILDBASE/$branch"
70                 git reset --hard  &&
71                 git checkout "$branch" &&
72                 git reset --hard  || exit
73                 case "$private" in
74                 '')
75                         ;;
76                 ?*)
77                         git merge --squash --no-commit "$private" || {
78                                 echo >&2 "Cannot apply private edition changes"
79                                 git reset --hard
80                         }
81                         ;;
82                 esac &&
83
84                 case "$with_dash" in
85                 y)
86                         case "$branch" in
87                         master | maint | next | jch)
88                                 Meta/Make $M -- $J SHELL_PATH=/bin/dash $dotest
89                                 ;;
90                         esac
91                         ;;
92                 esac &&
93
94                 Meta/Make $M -- $J $dotest &&
95                 case "$branch" in
96                 jch)
97                         test -n "$nodoc" || Meta/Make $M -- doc install-doc
98                         ;;
99                 master | maint | next )
100                         test -n "$nodoc" || Meta/Make $M -- doc
101                         ;;
102                 *)
103                         : ;;
104                 esac &&
105                 {
106                         test z$install = znoinstall ||
107                         Meta/Make $M -- install
108                 } || exit $?
109
110                 git reset --hard
111         ) || break;
112
113 done