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#*=} ;;
17 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
23 test -f /bin
/dash || with_dash
=
24 test -n "$BUILDBASE" || BUILDBASE
=..
/buildfarm
25 test -n "$branches" || branches
='next master maint pu jch'
26 test -n "$jobs" ||
jobs=-j2
28 for branch
in $branches
31 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
36 if test ! -d "$BUILDBASE/$branch"
38 if test -z "$bootstrap"
40 echo "** No $BUILDBASE/$branch"
43 "$NWD" .
"$BUILDBASE/$branch" $branch &&
44 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
45 echo "** Failed to bootstrap $BUILDBASE/$branch"
50 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
51 case $?
in 0|
1) ;; *) exit $?
;; esac
53 if test -f "$HOME/git-$branch/bin/git" &&
54 installed
=$
($HOME/git-
$branch/bin
/git version
) &&
55 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
58 elif version
=v$
(expr "$installed" : \
59 'git version \(.*\)\.rc[0-9]*$')
61 version
="$version"-$
(expr "$installed" : \
62 'git version .*\.\(rc[0-9]*\)$')
64 version
=v$
(expr "$installed" : 'git version \(.*\)')
66 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
67 test "z$version" = "z$revision"
69 echo "* up-to-date version \"$installed\" is already installed from $branch"
70 test -n "$force" ||
continue
74 case "$branch, $branches " in
76 if git
diff --quiet --exit-code jch next
87 cd "$BUILDBASE/$branch"
89 case "$(git symbolic-ref HEAD)" in
93 git checkout
"$branch" &&
94 git
reset --hard ||
exit
101 git merge
--squash --no-commit "$private" ||
{
102 echo >&2 "** Cannot apply private edition changes"
109 test "z$with_dash" != 'zy' ||
110 Meta
/Make
$M -- $jobs SHELL_PATH
=/bin
/dash
$dotest
113 Meta
/Make
$M -- $jobs $dotest &&
116 Meta
/Make
$M -- doc install-doc
120 test z
$install = znoinstall ||
121 Meta
/Make
$M -- install