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=
22 --pedantic |
--locale=* |
--loose) M
="$M $1" ;;
24 --dash) with_dash
=y
;;
25 --noinstall) install=noinstall
;;
28 --test=*) test="$1" ;;
29 --scratch) scratch
=y
;;
30 --bootstrap) bootstrap
=y
;;
31 --base=*) BUILDBASE
=${1#*=} ;;
32 --branches=*) branches
=${1#*=} ;;
34 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
41 sh
-c 'asciidoc --version >/dev/null 2>&1' || nodoc
=y
43 test -f /bin
/dash || with_dash
=
44 if test -z "$BUILDBASE"
46 if test -d "$inst_prefix/buildfarm"
48 BUILDBASE
="$inst_prefix/buildfarm"
49 elif test -d "../buildfarm"
51 BUILDBASE
=..
/buildfarm
53 echo >&2 "Buildbase unknown"
57 test -n "$branches" || branches
='next master maint jch pu'
58 test -n "$jobs" ||
jobs=-j2
60 for branch
in $branches
63 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
68 if test ! -d "$BUILDBASE/$branch"
70 if test -z "$bootstrap"
72 echo "** No $BUILDBASE/$branch"
75 "$NWD" .
"$BUILDBASE/$branch" $branch &&
76 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
77 echo "** Failed to bootstrap $BUILDBASE/$branch"
82 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
83 case $?
in 0|
1) ;; *) exit $?
;; esac
85 if test -f "$inst_prefix/git-$branch/bin/git" &&
86 installed
=$
($inst_prefix/git-
$branch/bin
/git version
) &&
87 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
90 elif version
=v$
(expr "$installed" : \
91 'git version \(.*\)\.rc[0-9]*$')
93 version
="$version"-$
(expr "$installed" : \
94 'git version .*\.\(rc[0-9]*\)$')
96 version
=v$
(expr "$installed" : 'git version \(.*\)')
98 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
99 test "z$version" = "z$revision"
101 echo "* up-to-date version \"$installed\" is already installed from $branch"
102 test -n "$force" ||
continue
106 case "$branch, $branches " in
108 if git
diff --quiet --exit-code jch next
118 test -z "$notest" || dotest
=
120 cd "$BUILDBASE/$branch"
122 case "$(git symbolic-ref HEAD)" in
123 "refs/heads/$branch")
126 git checkout
"$branch" &&
127 git
reset --hard ||
exit
142 git merge
--squash --no-commit "$private" ||
{
143 echo >&2 "** Cannot apply private edition changes"
149 save
=$
(git rev-parse HEAD
) &&
152 test "z$with_dash" != 'zy' ||
153 Meta
/Make
$M ${test+"$test"} -- $jobs SHELL_PATH
=/bin
/dash
$dotest
156 Meta
/Make
$M ${test+"$test"} -- $jobs $dotest &&
160 if test "$save" = "$(git rev-parse HEAD)"
162 Meta
/Make
$M -- $jobs doc
&&
163 Meta
/Make
$M -- install-man install-html
165 echo >&2 "Head moved--not installing docs"
170 test z
$install = znoinstall ||
171 if test "$save" = "$(git rev-parse HEAD)"
173 Meta
/Make
$M -- install
175 echo >&2 "Head moved--not installing"