Meta/Dothem: pass --locale=* to underlying Meta/Make
[git/spearce.git] / Dothem
blob38a37f2ba4bc7092cd52c04bf4bcb95e8c9b1d11
1 #!/bin/sh
3 NWD=contrib/workdir/git-new-workdir
5 force= with_dash= M= install= nodoc= bootstrap= branches= jobs=
6 while case "$1" in
7 --pedantic) M="$M $1" ;;
8 --locale=*) M="$M $1" ;;
9 --force) force=$1 ;;
10 --dash) with_dash=y ;;
11 --noinstall) install=noinstall ;;
12 --nodoc) nodoc=y ;;
13 --bootstrap) bootstrap=y ;;
14 --base=*) BUILDBASE=${1#*=} ;;
15 --branches=*) branches=${1#*=} ;;
16 -j*) jobs=$1 ;;
17 *) break ;;
18 esac
20 shift
21 done
22 test -f /bin/dash || with_dash=
23 test -n "$BUILDBASE" || BUILDBASE=../buildfarm
24 test -n "$branches" || branches='next master maint pu jch'
25 test -n "$jobs" || jobs=-j2
27 for branch in $branches
29 echo "** $branch **"
30 revision=$(git show-ref -s --verify "refs/heads/$branch") || {
31 echo "** No $branch"
32 continue
35 if test ! -d "$BUILDBASE/$branch"
36 then
37 if test -z "$bootstrap"
38 then
39 echo "** No $BUILDBASE/$branch"
40 continue
42 "$NWD" . "$BUILDBASE/$branch" $branch &&
43 "$NWD" Meta "$BUILDBASE/$branch/Meta" || {
44 echo "** Failed to bootstrap $BUILDBASE/$branch"
45 continue
49 private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
50 case $? in 0|1) ;; *) exit $? ;; esac
52 if test -f "$HOME/git-$branch/bin/git" &&
53 installed=$($HOME/git-$branch/bin/git version) &&
54 if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
55 then
57 elif version=v$(expr "$installed" : \
58 'git version \(.*\)\.rc[0-9]*$')
59 then
60 version="$version"-$(expr "$installed" : \
61 'git version .*\.\(rc[0-9]*\)$')
62 else
63 version=v$(expr "$installed" : 'git version \(.*\)')
64 fi &&
65 version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
66 test "z$version" = "z$revision"
67 then
68 echo "* up-to-date version \"$installed\" is already installed from $branch"
69 test -n "$force" || continue
73 case "$branch, $branches " in
74 jch,*' next '*)
75 if git diff --quiet --exit-code jch next
76 then
77 dotest=
78 else
79 dotest=test
83 dotest=test ;;
84 esac
86 cd "$BUILDBASE/$branch"
87 git reset --hard &&
88 case "$(git symbolic-ref HEAD)" in
89 "refs/heads/$branch")
90 : ;;
92 git checkout "$branch" &&
93 git reset --hard || exit
94 esac &&
96 case "$private" in
97 '')
99 ?*)
100 git merge --squash --no-commit "$private" || {
101 echo >&2 "** Cannot apply private edition changes"
102 git reset --hard
105 esac &&
108 test "z$with_dash" != 'zy' ||
109 Meta/Make $M -- $jobs SHELL_PATH=/bin/dash $dotest
110 } &&
112 Meta/Make $M -- $jobs $dotest &&
114 test -n "$nodoc" ||
115 Meta/Make $M -- doc install-doc
116 } &&
119 test z$install = znoinstall ||
120 Meta/Make $M -- install
121 } || exit $?
123 git reset --hard
124 ) || break;
126 done