|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
: ${J=-j2}
|
|
|
|
: ${BUILDBASE=../buildfarm}
|
|
|
|
: ${branches='next master maint pu jch'}
|
|
|
|
|
|
|
|
force= with_dash= M= install= nodoc=
|
|
|
|
while case "$1" in
|
|
|
|
-pedantic) M=$1 ;;
|
|
|
|
-force) force=$1 ;;
|
|
|
|
-dash) with_dash=y ;;
|
|
|
|
-noinstall) install=noinstall ;;
|
|
|
|
-nodoc) nodoc=y ;;
|
|
|
|
*) break ;;
|
|
|
|
esac
|
|
|
|
do
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
test -f /bin/dash || with_dash=
|
|
|
|
|
|
|
|
for branch in $branches
|
|
|
|
do
|
|
|
|
echo "** $branch **"
|
|
|
|
revision=$(git show-ref -s --verify "refs/heads/$branch") || {
|
|
|
|
echo "** No $branch"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
test -d "$BUILDBASE/$branch" || {
|
|
|
|
echo "** No $BUILDBASE/$branch"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
private=$(git rev-parse -q --verify private-$branch 2>/dev/null)
|
|
|
|
case $? in 0|1) ;; *) exit $? ;; esac
|
|
|
|
|
|
|
|
if installed=$($HOME/git-$branch/bin/git version) &&
|
|
|
|
if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
|
|
|
|
then
|
|
|
|
:
|
|
|
|
elif version=v$(expr "$installed" : \
|
|
|
|
'git version \(.*\)\.rc[0-9]*$')
|
|
|
|
then
|
|
|
|
version="$version"-$(expr "$installed" : \
|
|
|
|
'git version .*\.\(rc[0-9]*\)$')
|
|
|
|
else
|
|
|
|
version=v$(expr "$installed" : 'git version \(.*\)')
|
|
|
|
fi &&
|
|
|
|
version=$(git rev-parse --verify "$version^0" 2>/dev/null) &&
|
|
|
|
test "z$version" = "z$revision"
|
|
|
|
then
|
|
|
|
echo "* up-to-date version \"$installed\" is already installed from $branch"
|
|
|
|
test -n "$force" || continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
(
|
|
|
|
case "$branch, $branches " in
|
|
|
|
jch,*' next '*)
|
|
|
|
if git diff --quiet --exit-code jch next
|
|
|
|
then
|
|
|
|
dotest=
|
|
|
|
else
|
|
|
|
dotest=test
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
dotest=test ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
cd "$BUILDBASE/$branch"
|
|
|
|
git reset --hard &&
|
|
|
|
git checkout "$branch" &&
|
|
|
|
git reset --hard || exit
|
|
|
|
case "$private" in
|
|
|
|
'')
|
|
|
|
;;
|
|
|
|
?*)
|
|
|
|
git merge --squash --no-commit "$private" || {
|
|
|
|
echo >&2 "Cannot apply private edition changes"
|
|
|
|
git reset --hard
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
esac &&
|
|
|
|
|
|
|
|
case "$with_dash" in
|
|
|
|
y)
|
|
|
|
case "$branch" in
|
|
|
|
master | maint | next | jch)
|
|
|
|
Meta/Make $M -- $J SHELL_PATH=/bin/dash $dotest
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac &&
|
|
|
|
|
|
|
|
Meta/Make $M -- $J $dotest &&
|
|
|
|
case "$branch" in
|
|
|
|
jch)
|
|
|
|
test -n "$nodoc" || Meta/Make $M -- doc install-doc
|
|
|
|
;;
|
|
|
|
master | maint | next )
|
|
|
|
test -n "$nodoc" || Meta/Make $M -- doc
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
: ;;
|
|
|
|
esac &&
|
|
|
|
{
|
|
|
|
test z$install = znoinstall ||
|
|
|
|
Meta/Make $M -- install
|
|
|
|
} || exit $?
|
|
|
|
|
|
|
|
git reset --hard
|
|
|
|
) || break;
|
|
|
|
|
|
|
|
done
|