summaryrefslogtreecommitdiff
path: root/process
diff options
context:
space:
mode:
Diffstat (limited to 'process')
-rwxr-xr-xprocess134
1 files changed, 134 insertions, 0 deletions
diff --git a/process b/process
new file mode 100755
index 00000000..9d60bb0d
--- /dev/null
+++ b/process
@@ -0,0 +1,134 @@
+#!/bin/sh
+
+set -e -x
+
+project=$1
+case $project in
+ gcc)
+ branch=hurd/master
+ ;;
+ *)
+ echo >&2 "Don't know about project »$project«."
+ exit 1
+ ;;
+esac
+shift
+
+step=$1
+case $step in
+ build | install | test)
+ ;;
+ '')
+ # If there is no step specified, try a default set.
+ "$0" "$project" build
+ "$0" "$project" install
+ "$0" "$project" test
+ exit
+ ;;
+ *)
+ echo >&2 "Don't know about step »$step«."
+ exit 1
+ ;;
+esac
+shift
+
+host=$1
+case $host in
+ coulomb.SCHWINGE)
+ project_base=tmp/"$project"
+ mount=/media/erich
+ ;;
+ kepler.SCHWINGE)
+ project_base=tmp/source/"$project"
+ mount=/media/data
+ ;;
+ '')
+ # If there is no host specified, we know which two to use and what to do
+ # with the results. May want to separate the fetch and diff steps.
+ h1=kepler.SCHWINGE
+ h2=coulomb.SCHWINGE
+ "$0" "$project" "$step" "$h1"
+ "$0" "$project" "$step" "$h2"
+ case $step in
+ build | install)
+ sed \
+ -f toolchain/logs/"$project"/"$h1"/"$step".sed \
+ < toolchain/logs/"$project"/"$h1"/"$step" \
+ > toolchain/logs/"$project"/"$h1"/"$step"_
+ sed \
+ -f toolchain/logs/"$project"/"$h2"/"$step".sed \
+ < toolchain/logs/"$project"/"$h2"/"$step" \
+ > toolchain/logs/"$project"/"$h2"/"$step"_
+ r=0
+ diff \
+ -wu -F ^Running \
+ toolchain/logs/"$project"/"$h1"/"$step"_ \
+ toolchain/logs/"$project"/"$h2"/"$step"_ \
+ > toolchain/logs/"$project"/"$step".diff \
+ || r=$?
+ rm \
+ -f \
+ toolchain/logs/"$project"/"$h1"/"$step"_ \
+ toolchain/logs/"$project"/"$h2"/"$step"_
+ [ "$r" = 0 ] || [ "$r" = 1 ]
+ exit
+ ;;
+ test)
+ r=0
+ diff \
+ -Nrwu -F ^Running \
+ toolchain/logs/"$project"/"$h1"/"$step"/ \
+ toolchain/logs/"$project"/"$h2"/"$step"/ \
+ > toolchain/logs/"$project"/"$step".diff \
+ || r=$?
+ [ "$r" = 0 ] || [ "$r" = 1 ]
+ exit
+ ;;
+ *)
+ echo >&2 "Internal error."
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo >&2 "Don't know about host »$host«."
+ exit 1
+ ;;
+esac
+shift
+
+: "${branch:?}"
+: "${mount:?}"
+: "${project_base:?}"
+case $project:$step:$host in
+ gcc:build:* | gcc:install:*)
+ ssh \
+ "$host" \
+ 'cd '"$project_base"'/ && \
+ cat '"$branch"'.build/log_'"$step"'* \
+ | sed -e "s%\('"$mount"'\)\?${PWD}%[...]%g"' \
+ > toolchain/logs/"$project"/"$host"/"$step"
+ ;;
+ gcc:test:*)
+ rsync \
+ -vd --delete \
+ --rsync-path='\
+ cd '"$project_base"'/ && \
+ base=$PWD && \
+ rm -rf '"$branch"'.build.sums && \
+ mkdir '"$branch"'.build.sums && \
+ cd '"$branch"'.build.sums/ && \
+ find "$base"/'"$branch"'.build/ -name \*.sum \
+ -exec cp -bt ./ \{\} \; && \
+ for f in *; do \
+ sed -e "s%\('"$mount"'\)\?${base}%[...]%g" -i "$f" \
+ || exit $?; \
+ done &&\
+ rsync' "$host": \
+ toolchain/logs/"$project"/"$host"/"$step"/
+ ;;
+ *)
+ echo >&2 "Internal error."
+ exit 1
+ ;;
+esac