3 NWD
=contrib
/workdir
/git-new-workdir
9 probed
=${p%/git-active/bin}
10 if test "$probed" != "$p"
19 force
= with_dash
= M
= install= nodoc
= notest
= bootstrap
= branches
= jobs=
21 --pedantic |
--locale=* |
--loose) M
="$M $1" ;;
23 --dash) with_dash
=y
;;
24 --noinstall) install=noinstall
;;
27 --bootstrap) bootstrap
=y
;;
28 --base=*) BUILDBASE
=${1#*=} ;;
29 --branches=*) branches
=${1#*=} ;;
31 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
37 test -f /bin
/dash || with_dash
=
38 if test -z "$BUILDBASE"
40 if test -d "$inst_prefix/buildfarm"
42 BUILDBASE
="$inst_prefix/buildfarm"
43 elif test -d "../buildfarm"
45 BUILDBASE
=..
/buildfarm
47 echo >&2 "Buildbase unknown"
51 test -n "$branches" || branches
='next master maint pu jch'
52 test -n "$jobs" ||
jobs=-j2
54 for branch
in $branches
57 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
62 if test ! -d "$BUILDBASE/$branch"
64 if test -z "$bootstrap"
66 echo "** No $BUILDBASE/$branch"
69 "$NWD" .
"$BUILDBASE/$branch" $branch &&
70 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
71 echo "** Failed to bootstrap $BUILDBASE/$branch"
76 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
77 case $?
in 0|
1) ;; *) exit $?
;; esac
79 if test -f "$inst_prefix/git-$branch/bin/git" &&
80 installed
=$
($inst_prefix/git-
$branch/bin
/git version
) &&
81 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
84 elif version
=v$
(expr "$installed" : \
85 'git version \(.*\)\.rc[0-9]*$')
87 version
="$version"-$
(expr "$installed" : \
88 'git version .*\.\(rc[0-9]*\)$')
90 version
=v$
(expr "$installed" : 'git version \(.*\)')
92 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
93 test "z$version" = "z$revision"
95 echo "* up-to-date version \"$installed\" is already installed from $branch"
96 test -n "$force" ||
continue
100 case "$branch, $branches " in
102 if git
diff --quiet --exit-code jch next
112 test -z "$notest" || dotest
=
114 cd "$BUILDBASE/$branch"
116 case "$(git symbolic-ref HEAD)" in
117 "refs/heads/$branch")
120 git checkout
"$branch" &&
121 git
reset --hard ||
exit
128 git merge
--squash --no-commit "$private" ||
{
129 echo >&2 "** Cannot apply private edition changes"
136 test "z$with_dash" != 'zy' ||
137 Meta
/Make
$M -- $jobs SHELL_PATH
=/bin
/dash
$dotest
140 Meta
/Make
$M -- $jobs $dotest &&
143 Meta
/Make
$M -- doc install-doc
147 test z
$install = znoinstall ||
148 Meta
/Make
$M -- install