3 NWD
=contrib
/workdir
/git-new-workdir
5 force
= with_dash
= M
= install= nodoc
= bootstrap
= branches
= jobs=
7 --pedantic) M
="$M $1" ;;
8 --locale=*) M
="$M $1" ;;
10 --dash) with_dash
=y
;;
11 --noinstall) install=noinstall
;;
13 --bootstrap) bootstrap
=y
;;
14 --base=*) BUILDBASE
=${1#*=} ;;
15 --branches=*) branches
=${1#*=} ;;
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
30 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
35 if test ! -d "$BUILDBASE/$branch"
37 if test -z "$bootstrap"
39 echo "** No $BUILDBASE/$branch"
42 "$NWD" .
"$BUILDBASE/$branch" $branch &&
43 "$NWD" Meta
"$BUILDBASE/$branch/Meta" ||
{
44 echo "** Failed to bootstrap $BUILDBASE/$branch"
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]*\)$')
57 elif version
=v$
(expr "$installed" : \
58 'git version \(.*\)\.rc[0-9]*$')
60 version
="$version"-$
(expr "$installed" : \
61 'git version .*\.\(rc[0-9]*\)$')
63 version
=v$
(expr "$installed" : 'git version \(.*\)')
65 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
66 test "z$version" = "z$revision"
68 echo "* up-to-date version \"$installed\" is already installed from $branch"
69 test -n "$force" ||
continue
73 case "$branch, $branches " in
75 if git
diff --quiet --exit-code jch next
86 cd "$BUILDBASE/$branch"
88 case "$(git symbolic-ref HEAD)" in
92 git checkout
"$branch" &&
93 git
reset --hard ||
exit
100 git merge
--squash --no-commit "$private" ||
{
101 echo >&2 "** Cannot apply private edition changes"
108 test "z$with_dash" != 'zy' ||
109 Meta
/Make
$M -- $jobs SHELL_PATH
=/bin
/dash
$dotest
112 Meta
/Make
$M -- $jobs $dotest &&
115 Meta
/Make
$M -- doc install-doc
119 test z
$install = znoinstall ||
120 Meta
/Make
$M -- install