#!/bin/sh
-build_host="ka2"
-build_dir="/scratch/sfr/next"
+. "$(dirname $0)/common.sh"
-[ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST"
-[ "$NEXT_BUILD_DIR" ] && build_dir="$NEXT_BUILD_DIR"
+bparent=$(dirname "$build_dir")
+bdir=$(basename "$build_dir")
-[ -n "$1" ] && {
- build_host="$1"
- shift
-}
-[ -n "$1" ] && {
- build_dir="$1"
- shift
-}
-
-ssh "$build_host" /bin/sh <<EOF
+cmd=
+[ "$build_host" ] &&
+ cmd="ssh $build_host"
+$cmd /bin/sh <<EOF
set -x -e
- [ -d "$build_dir" ] || mkdir -p "$build_dir"
- cd "$build_dir/.."
- rm -rf *config
- rm -rf next
+ [ -d "$bparent" ] || mkdir -p "$bparent"
+ cd "$bparent"
+ rm -rf *config perf *config.log perf.log lib *.except
[ -d tmp ] || mkdir tmp
[ -d .ccache ] || mkdir .ccache
- cd linus.git
- git remote update || true
- cd ..
- git clone -s -l -c gc.auto=0 linus.git next
+ (
+ cd linus.git
+ git remote update fs || true
+ git remote update origin || true
+ )
+ rm -rf "$bdir"
+ git clone -s -l -c gc.auto=0 linus.git "$bdir"
+ cp /dev/null log-ignore
EOF