#!/bin/sh
-try_if_new () {
- branch="$1"
- to_install="$2"
- commits=$(git-rev-list "ko-${branch}..${branch}")
+J=
- to_build=no
- case "$commits" in
- '')
- echo "* Up-to-date at ko-$branch"
- to_build=no
- ;;
- *)
- to_build=yes
- ;;
- esac
+test -z "$(git diff --cached --name-status)" || {
+ echo >&2 "Repository unclean."
+ exit 1
+}
+Meta/Make clean >/dev/null 2>&1
- case "$to_install" in
- ?*)
- to_build=yes
- ;;
- esac
+branches='next master maint'
- case "$to_build" in
- yes)
- Meta/Make clean >/dev/null 2>&1 &&
- git checkout "$branch" &&
- echo "* Testing $branch" &&
- Meta/Make clean test >./":${branch}.log" 2>&1 &&
- case "$to_install" in
- ?*)
- Meta/Make install >>./":${branch}.log" 2>&1 ;;
- esac
- esac
-}
+nstall=install
+for branch in $branches
+do
+ if git rev-parse --verify refs/heads/$branch 2>/dev/null
+ then
+ echo "* $branch" &&
+ git checkout $branch &&
+ Meta/Make $J all &&
+ Meta/Make $J $nstall &&
+ Meta/Make test &&
+ Meta/Make clean &&
+ nstall=all || exit $?
+ else
+ echo "* No $branch"
+ fi
+done >./:all.log 2>&1
-git fetch ko &&
+git checkout master
-try_if_new maint &&
-try_if_new pu &&
-try_if_new master install &&
-Meta/Make clean >/dev/null 2>&1