3 NWD
=contrib
/workdir
/git-new-workdir
5 force
= with_dash
= M
= install= nodoc
= bootstrap
= branches
= jobs=
7 --pedantic) M
="$M $1" ;;
10 --noinstall) install=noinstall
;;
12 --bootstrap) bootstrap
=y
;;
13 --base=*) BUILDBASE
=${1#*=} ;;
14 --branches=*) branches
=${1#*=} ;;
21 test -f /bin
/dash || with_dash
=
22 test -n "$BUILDBASE" || BUILDBASE
=..
/buildfarm
23 test -n "$branches" || branches
='next master maint pu jch'
24 test -n "$jobs" ||
jobs=-j2
26 for branch
in $branches
29 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
34 if test ! -d "$BUILDBASE/$branch"
36 if test -z "$bootstrap"
38 echo "** No $BUILDBASE/$branch"
41 "$NWD" .
"$BUILDBASE/$branch" $branch &&
42 "$NWD" Meta
"$BUILDBASE/$branch/Meta" ||
{
43 echo "** Failed to bootstrap $BUILDBASE/$branch"
48 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
49 case $?
in 0|
1) ;; *) exit $?
;; esac
51 if test -f "$HOME/git-$branch/bin/git" &&
52 installed
=$
($HOME/git-
$branch/bin
/git version
) &&
53 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
56 elif version
=v$
(expr "$installed" : \
57 'git version \(.*\)\.rc[0-9]*$')
59 version
="$version"-$
(expr "$installed" : \
60 'git version .*\.\(rc[0-9]*\)$')
62 version
=v$
(expr "$installed" : 'git version \(.*\)')
64 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
65 test "z$version" = "z$revision"
67 echo "* up-to-date version \"$installed\" is already installed from $branch"
68 test -n "$force" ||
continue
72 case "$branch, $branches " in
74 if git
diff --quiet --exit-code jch next
85 cd "$BUILDBASE/$branch"
87 case "$(git symbolic-ref HEAD)" in
91 git checkout
"$branch" &&
92 git
reset --hard ||
exit
99 git merge
--squash --no-commit "$private" ||
{
100 echo >&2 "** Cannot apply private edition changes"
107 test "z$with_dash" != 'zy' ||
108 Meta
/Make
$M -- $jobs SHELL_PATH
=/bin
/dash
$dotest
111 Meta
/Make
$M -- $jobs $dotest &&
114 Meta
/Make
$M -- doc install-doc
118 test z
$install = znoinstall ||
119 Meta
/Make
$M -- install