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" && test -d "$TRASH" && test -w "$TRASH"
45 TRASH
="--root=$TRASH/testpen"
50 sh
-c 'asciidoc --version >/dev/null 2>&1' || nodoc
=y
51 if sh
-c 'prove --version >/dev/null 2>&1' &&
52 sh
-c 'prove --exec : >/dev/null 2>&1'
54 DEFAULT_TEST_TARGET
=prove GIT_PROVE_OPTS
="$jobs"
55 export DEFAULT_TEST_TARGET GIT_PROVE_OPTS
57 GIT_TEST_OPTS
="$TRASH${GIT_TEST_OPTS+" $GIT_TEST_OPTS"}"
60 test -f /bin
/dash || with_dash
=
61 if test -z "$BUILDBASE"
63 if test -d "$inst_prefix/buildfarm"
65 BUILDBASE
="$inst_prefix/buildfarm"
66 elif test -d "../buildfarm"
68 BUILDBASE
=..
/buildfarm
70 echo >&2 "Buildbase unknown"
74 test -n "$branches" || branches
='next master maint jch pu'
75 test -n "$jobs" ||
jobs=-j2
77 for branch
in $branches
80 revision
=$
(git show-ref
-s --verify "refs/heads/$branch") ||
{
85 if test ! -d "$BUILDBASE/$branch"
87 if test -z "$bootstrap"
89 echo "** No $BUILDBASE/$branch"
92 "$NWD" .
"$BUILDBASE/$branch" $branch &&
93 ln -s "$(pwd)/Meta" "$BUILDBASE/$branch/Meta" ||
{
94 echo "** Failed to bootstrap $BUILDBASE/$branch"
99 private
=$
(git rev-parse
-q --verify private-
$branch 2>/dev
/null
)
100 case $?
in 0|
1) ;; *) exit $?
;; esac
102 if test -f "$inst_prefix/git-$branch/bin/git" &&
103 installed
=$
($inst_prefix/git-
$branch/bin
/git version
) &&
104 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
107 elif version
=v$
(expr "$installed" : \
108 'git version \(.*\)\.rc[0-9]*$')
110 version
="$version"-$
(expr "$installed" : \
111 'git version .*\.\(rc[0-9]*\)$')
113 version
=v$
(expr "$installed" : 'git version \(.*\)')
115 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
) &&
116 test "z$version" = "z$revision"
118 echo "* up-to-date version \"$installed\" is already installed from $branch"
119 test -n "$force" ||
continue
123 case "$branch, $branches " in
125 if git
diff --quiet --exit-code jch next
135 test -z "$notest" || dotest
=
137 cd "$BUILDBASE/$branch"
139 case "$(git symbolic-ref HEAD)" in
140 "refs/heads/$branch")
143 git checkout
"$branch" &&
144 git
reset --hard ||
exit
159 git merge
--squash --no-commit "$private" ||
{
160 echo >&2 "** Cannot apply private edition changes"
166 save
=$
(git rev-parse HEAD
) &&
168 Meta
/Make
$M ${test+"$test"} $jobs -- ${with_dash:+SHELL_PATH=/bin/dash} $dotest &&
172 if test "$save" = "$(git rev-parse HEAD)"
174 Meta
/Make
$M $jobs -- doc
&&
175 Meta
/Make
$M -- install-man install-html
177 echo >&2 "Head moved--not installing docs"
182 test z
$install = znoinstall ||
183 if test "$save" = "$(git rev-parse HEAD)"
185 Meta
/Make
$M -- install
187 echo >&2 "Head moved--not installing"
192 ) </dev
/null ||
exit $?