3 NWD
=contrib
/workdir
/git-new-workdir
10 probed
=${p%/git-active/bin}
11 if test "$probed" != "$p"
20 force
= with_dash
= test_long
= M
= install= doc
= notest
= bootstrap
= branches
= jobs=
21 scratch
= noprove
= memtrash
=--memtrash with_cocci
= san
= clean
=
23 --pedantic |
--locale=* |
--loose) M
="$M $1" ;;
25 --dash) with_dash
=y
;;
27 --cocci) with_cocci
=y
;;
28 --no-cocci) with_cocci
= ;;
29 --long) test_long
=--long ;;
30 --noinstall) install=noinstall
;;
32 --asciidoc) doc
=asciidoc
;;
33 --asciidoctor) doc
=ascidoctor
;;
35 --nomemtrash) memtrash
= ;;
36 --memtrash) memtrash
=--memtrash ;;
37 --test=*) test="$1" ;;
38 --scratch) scratch
=y
;;
39 --bootstrap) bootstrap
=y
;;
40 --base=*) BUILDBASE
=${1#*=} ;;
41 --branches=*) branches
=${1#*=} ;;
42 --noprove) noprove
=$1 ;;
46 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
55 : ;# happy with whatever specified
56 elif sh
-c 'asciidoc --version >/dev/null 2>&1'
59 elif sh
-c 'asciidoctor --version >/dev/null 2>&1'
66 if test "$doc" = asciidoctor
68 USE_ASCIIDOCTOR
=YesPlease
74 export GIT_TEST_CHAIN_LINT
76 GIT_PROVE_OPTS
="${GIT_PROVE_OPTS:+$GIT_PROVE_OPTS }--state=slow,save"
79 test -f /bin
/dash || with_dash
=
80 if test -z "$BUILDBASE"
82 if test -d "$inst_prefix/buildfarm"
84 BUILDBASE
="$inst_prefix/buildfarm"
85 elif test -d "../buildfarm"
87 BUILDBASE
=..
/buildfarm
89 echo >&2 "Buildbase unknown"
93 test -n "$branches" || branches
="next $MASTER maint jch seen"
94 test -n "$jobs" ||
jobs=-j2
98 test -f "$inst_prefix/git-$branch/bin/git" &&
99 installed
=$
($inst_prefix/git-
$branch/bin
/git version
) &&
100 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
103 elif version
=v$
(expr "$installed" : \
104 'git version \(.*\)\.rc[0-9]*$')
106 version
="$version"-$
(expr "$installed" : \
107 'git version .*\.\(rc[0-9]*\)$')
109 version
=v$
(expr "$installed" : 'git version \(.*\)')
111 git rev-parse
--verify "$version^0" 2>/dev
/null
114 installed_source_trees
=" "
115 for branch
in $branches
117 if v
=$
(find_installed
$branch) &&
119 v
=$
(git rev-parse
--verify "$v^{tree}" 2>/dev
/null
)
121 installed_source_trees
="$installed_source_trees$v "
125 for branch
in $branches
128 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
133 if test ! -d "$BUILDBASE/$branch"
135 if test -z "$bootstrap"
137 echo "** No $BUILDBASE/$branch"
140 "$NWD" .
"$BUILDBASE/$branch" $branch &&
141 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
142 echo "** Failed to bootstrap $BUILDBASE/$branch"
147 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
148 case $?
in 0|
1) ;; *) exit $?
;; esac
150 version
=$
(find_installed
$branch)
151 if test "z$version" = "z$revision"
153 echo "* up-to-date version is already installed from $branch"
154 test -n "$force" ||
continue
157 vtree
=$
(git rev-parse
--verify "$version^{tree}")
158 rtree
=$
(git rev-parse
--verify "$revision^{tree}")
161 case "$doc" in no
) skip_doc
=1 ;; *) skip_doc
= ;; esac
166 for xtree
in $installed_source_trees $vtree
168 if test "z$xtree" = "z$rtree" ||
169 git
diff --quiet "$xtree" "$rtree" -- . \
170 ':!GIT-VERSION-GEN' \
179 dvtree
=$
(git rev-parse
--verify "$version:Documentation/")
180 drtree
=$
(git rev-parse
--verify "$revision:Documentation/")
181 if test "z$dvtree" = "z$drtree"
193 cd "$BUILDBASE/$branch"
196 case "$scratch$clean" in
200 saveMeta
=$
(readlink Meta
)
203 ln -s "$saveMeta" Meta
207 case "$(git symbolic-ref HEAD)" in
208 "refs/heads/$branch")
211 git checkout
"$branch" &&
212 git
reset --hard ||
exit
223 git merge
--squash --no-commit "$private" ||
{
224 echo >&2 "** Cannot apply private edition changes"
230 save
=$
(git rev-parse HEAD
) &&
232 if test -n "$with_cocci"
234 Meta
/Make
$M $jobs -- coccicheck
237 Meta
/Make
$M $jobs -- NO_REGEX
=NoThanks \
238 SPARSE_FLAGS
=-Wsparse-error sparse
&&
239 rm -f compat
/regex
/regex.o
&&
240 Meta
/Make
$M $jobs -- hdr-check
&&
242 case "$dotest,$san" in
246 Meta
/Make
$M $noprove ${test+"$test"} $jobs $test_long $memtrash \
247 -- ${with_dash:+SHELL_PATH=/bin/dash} "$@" $dotest
250 SANITIZE
=address
,undefined Meta
/Make
$M $jobs test &&
251 Meta
/Make
>/dev
/null distclean
256 test -n "$skip_doc" ||
257 if test "$save" = "$(git rev-parse HEAD)"
259 Meta
/Make
$M $jobs -- check-docs
&&
260 Meta
/Make
$M $jobs -- $USE_ASCIIDOCTOR doc
&&
261 Meta
/Make
$M -- install-man install-html
263 echo >&2 "Head moved--not installing docs"
268 test z
$install = znoinstall ||
269 if test "$save" = "$(git rev-parse HEAD)"
271 Meta
/Make
$M -- ${with_dash:+SHELL_PATH=/bin/dash} "$@" install
273 echo >&2 "Head moved--not installing"
278 ) </dev
/null ||
exit $?
280 installed_source_trees
="$installed_source_trees$rtree "