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 for TRASH
in /dev
/shm
/tmp
""
43 if test -n "$TRASH" &&
44 mkdir
-p "$TRASH/testpen" 2>/dev
/null
&&
45 test -w "TRASH/testpen"
47 TRASH
="--root=$(cd "$TRASH/testpen
" && /bin/pwd)"
52 sh
-c 'asciidoc --version >/dev/null 2>&1' || nodoc
=y
53 GIT_TEST_OPTS
="$TRASH${GIT_TEST_OPTS+" $GIT_TEST_OPTS"}"
56 test -f /bin
/dash || with_dash
=
57 if test -z "$BUILDBASE"
59 if test -d "$inst_prefix/buildfarm"
61 BUILDBASE
="$inst_prefix/buildfarm"
62 elif test -d "../buildfarm"
64 BUILDBASE
=..
/buildfarm
66 echo >&2 "Buildbase unknown"
70 test -n "$branches" || branches
='next master maint jch pu'
71 test -n "$jobs" ||
jobs=-j2
75 test -f "$inst_prefix/git-$branch/bin/git" &&
76 installed
=$
($inst_prefix/git-
$branch/bin
/git version
) &&
77 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
80 elif version
=v$
(expr "$installed" : \
81 'git version \(.*\)\.rc[0-9]*$')
83 version
="$version"-$
(expr "$installed" : \
84 'git version .*\.\(rc[0-9]*\)$')
86 version
=v$
(expr "$installed" : 'git version \(.*\)')
88 git rev-parse
--verify "$version^0" 2>/dev
/null
91 installed_source_trees
=" "
92 for branch
in $branches
94 if v
=$
(find_installed
$branch) &&
96 v
=$
(git rev-parse
--verify "$v^{tree}" 2>/dev
/null
)
98 installed_source_trees
="$installed_source_trees$v "
102 for branch
in $branches
105 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
110 if test ! -d "$BUILDBASE/$branch"
112 if test -z "$bootstrap"
114 echo "** No $BUILDBASE/$branch"
117 "$NWD" .
"$BUILDBASE/$branch" $branch &&
118 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
119 echo "** Failed to bootstrap $BUILDBASE/$branch"
124 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
125 case $?
in 0|
1) ;; *) exit $?
;; esac
127 version
=$
(find_installed
$branch)
128 if test "z$version" = "z$revision"
130 echo "* up-to-date version is already installed from $branch"
131 test -n "$force" ||
continue
134 vtree
=$
(git rev-parse
--verify "$version^{tree}")
135 rtree
=$
(git rev-parse
--verify "$revision^{tree}")
137 skip_test
=$notest skip_doc
=$nodoc
142 for xtree
in $installed_source_trees $vtree
144 if test "z$xtree" = "z$rtree" ||
145 git
diff --quiet "$xtree" "$rtree" -- . \
146 ':!GIT-VERSION-GEN' ':!Documentation/'
153 dvtree
=$
(git rev-parse
--verify "$version:Documentation/")
154 drtree
=$
(git rev-parse
--verify "$revision:Documentation/")
155 if test "z$dvtree" = "z$drtree"
167 cd "$BUILDBASE/$branch"
169 case "$(git symbolic-ref HEAD)" in
170 "refs/heads/$branch")
173 git checkout
"$branch" &&
174 git
reset --hard ||
exit
189 git merge
--squash --no-commit "$private" ||
{
190 echo >&2 "** Cannot apply private edition changes"
196 save
=$
(git rev-parse HEAD
) &&
198 Meta
/Make
$M ${test+"$test"} $jobs -- ${with_dash:+SHELL_PATH=/bin/dash} $dotest &&
201 test -n "$skip_doc" ||
202 if test "$save" = "$(git rev-parse HEAD)"
204 Meta
/Make
$M $jobs -- doc
&&
205 Meta
/Make
$M -- install-man install-html
207 echo >&2 "Head moved--not installing docs"
212 test z
$install = znoinstall ||
213 if test "$save" = "$(git rev-parse HEAD)"
215 Meta
/Make
$M -- ${with_dash:+SHELL_PATH=/bin/dash} install
217 echo >&2 "Head moved--not installing"
222 ) </dev
/null ||
exit $?
224 installed_source_trees
="$installed_source_trees$rtree "