-# -* autoconf -*-
+# -*- autoconf -*-
BP_INIT
remote=
CONFIGUREFLAGS=
n_envvars=0
+check=true
# Parse command line.
while test $# -gt 0 ; do
CONFIGUREFLAGS=$2
shift; shift ;;
+ --no-check )
+ check=false
+ shift ;;
+
-- ) # Stop option processing
shift; break ;;
-* )
AS_ERROR([$tarball does not exist])
fi
+case $BINID in # (
+ *[!-_.+~a-zA-Z0-9]*)
+ exec >&2
+ AS_ERROR([invalid binid $BINID])
+ ;;
+esac
+
REMOTE_HOST=
REMOTE_DIR=
case $remote in # (
if test "x$CONFIGUREFLAGS" != x; then
options="--configureflags='"`escape "$CONFIGUREFLAGS"`\'
fi
+ $check || options="$options --no-check"
$overwrite && options="$options --force"
i=0
while test $i -lt $n_envvars; do
AS_VAR_ARITH([i], [$i + 1])
AS_VAR_COPY([tmp], [env$i])
- options="$options '"`escape "$tmp"`"\'
+ options="$options '"`escape "$tmp"`\'
done
shift
exit $rc
fi
-if test -e "$BINID"; then
- if test $overwrite = true; then
- chmod -R u+w "$BINID"
- rm -rf "$BINID"
- else
- exec >&2
- AS_ERROR([$BINID exists and --force not specified])
+for dir in $BINID $BINID.buildtmp; do
+ if test -e $dir; then
+ if $overwrite; then
+ chmod -R u+w $dir
+ rm -rf $dir
+ else
+ exec >&2
+ AS_ERROR([$dir exists and --force not specified])
+ fi
fi
-fi
+ mkdir $dir || { exec >&2; AS_ERROR([failed to create $dir]); }
+done
BP_INIT_RESULTS([$BINID])
BP_INIT_LOG([$BINID/LOG])
fi
BP_START_STEP([Extracting source tarball])
-BP_RUN([zcat $tarball | tar xf - >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd $BINID.buildtmp && zcat ../$tarball | tar xf -) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Extracting tar version])
-DIST_VERSION=`$DIST_DIR/configure --version 2>/dev/null | sed 1q | sed 's/.* //'`
+DIST_VERSION=`$BINID.buildtmp/$DIST_DIR/configure --version 2>/dev/null | sed 1q | sed 's/.* //'`
BP_SET_VAR([DIST_VERSION])
+BP_START_STEP([Checking for GNU make])
+case `(make --version | sed 1q) 2>/dev/null` in # (
+ "GNU Make"*) GNU_MAKE=true ;;
+ *) GNU_MAKE=false ;;
+esac
+BP_SET_VAR([GNU_MAKE])
+
BP_START_STEP([Configuring])
-BP_RUN([mkdir $DIST_DIR/_$BINID >&AS_MESSAGE_LOG_FD 2>&1])
-BP_RUN([chmod -R a-w $DIST_DIR >&AS_MESSAGE_LOG_FD 2>&1])
-BP_RUN([chmod u+w $DIST_DIR/_$BINID >&AS_MESSAGE_LOG_FD 2>&1])
+srcdir=$BINID.buildtmp/$DIST_DIR
+if $GNU_MAKE; then
+ builddir=$srcdir/_$BINID
+ rel_srcdir=..
+ BP_RUN([mkdir $builddir >&AS_MESSAGE_LOG_FD 2>&1])
+ BP_RUN([chmod -R a-w $srcdir >&AS_MESSAGE_LOG_FD 2>&1])
+ BP_RUN([chmod u+w $builddir >&AS_MESSAGE_LOG_FD 2>&1])
+else
+ builddir=$srcdir
+ rel_srcdir=.
+ BP_RUN([find $builddir -type f -print | xargs chmod u-w >&AS_MESSAGE_LOG_FD 2>&1])
+ BP_RUN([chmod u+w $builddir >&AS_MESSAGE_LOG_FD 2>&1])
+fi
set x
i=0
done
shift
-BP_TRY_RUN([(cd $DIST_DIR/_$BINID && ../configure --enable-relocatable --prefix='' $CONFIGUREFLAGS "$@") >&AS_MESSAGE_LOG_FD 2>&1])
+BP_TRY_RUN([(cd $builddir && $rel_srcdir/configure --enable-relocatable --prefix='' $CONFIGUREFLAGS "$@") >&AS_MESSAGE_LOG_FD 2>&1])
_bp_status=$?
for base in config.h config.log; do
- fn=$DIST_DIR/_$BINID/$base
+ fn=$builddir/$base
if test -e "$fn"; then
BP_COPY_OUTPUT([build configuration], [$fn])
fi
done
if test $_bp_status != 0; then
AS_ECHO(["$as_me:$LINENO: command exited with status $_bp_status"]) >&AS_MESSAGE_LOG_FD
+ exit 1
fi
BP_START_STEP([Build])
-BP_RUN([(cd $DIST_DIR/_$BINID && make) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd $builddir && make) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Install])
-BP_RUN([(cd $DIST_DIR/_$BINID && make install DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd $builddir && make install DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Make binary distribution])
-BP_RUN([(cd $DIST_DIR/_$BINID && tar cfz pspp-$DIST_VERSION-$BINID.tar.gz pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
-BP_MOVE_OUTPUT([binary distribution], [$DIST_DIR/_$BINID/pspp-$DIST_VERSION-$BINID.tar.gz])
-
-BP_START_STEP([Check])
-BP_TRY_RUN([(cd $DIST_DIR/_$BINID && make check) >&AS_MESSAGE_LOG_FD 2>&1])
-_bp_status=$?
-for base in tests/testsuite.log tests/testsuite.dir; do
- fn=$DIST_DIR/_$BINID/$base
- if test -e "$fn"; then
- BP_MOVE_OUTPUT([test logs], [$fn])
+BP_RUN([(cd $builddir && tar cfz pspp-$DIST_VERSION-$BINID.tar.gz pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_MOVE_OUTPUT([binary distribution], [$builddir/pspp-$DIST_VERSION-$BINID.tar.gz])
+
+if $check; then
+ BP_START_STEP([Check])
+ BP_TRY_RUN([(cd $builddir && make check) >&AS_MESSAGE_LOG_FD 2>&1])
+ _bp_status=$?
+ for base in tests/testsuite.log tests/testsuite.dir; do
+ fn=$builddir/$base
+ if test -e "$fn"; then
+ BP_MOVE_OUTPUT([test logs], [$fn])
+ fi
+ done
+ if test $_bp_status != 0; then
+ AS_ECHO(["$as_me:$LINENO: command exited with status $_bp_status"]) >&AS_MESSAGE_LOG_FD
+ exit 1
fi
-done
-if test $_bp_status != 0; then
- AS_ECHO(["$as_me:$LINENO: command exited with status $_bp_status"]) >&AS_MESSAGE_LOG_FD
fi
BP_START_STEP([Uninstall])
-BP_RUN([(cd $DIST_DIR/_$BINID && make uninstall DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd $builddir && make uninstall DESTDIR=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
BP_START_STEP([Check uninstall])
-BP_RUN([(cd $DIST_DIR/_$BINID && make distuninstallcheck distuninstallcheck_dir=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
+BP_RUN([(cd $builddir && make distuninstallcheck distuninstallcheck_dir=$PWD/pspp-$DIST_VERSION-$BINID) >&AS_MESSAGE_LOG_FD 2>&1])
# distcleancheck
# Ensure that git repository exists.
GIT_DIR=$PWD/repo.git
export GIT_DIR
-git init
+if git init >/dev/null; then
+ :
+else
+ exec >&2
+ AS_ERROR([initializing Git repository in $GIT_DIR failed])
+fi
# Fetch PSPP source.
-git fetch $PSPP_REPO +$PSPP_BRANCH:refs/builds/$BUILD_NUMBER/pspp
+if git fetch $PSPP_REPO +$PSPP_BRANCH:refs/builds/$BUILD_NUMBER/pspp >/dev/null 2>&1; then
+ :
+else
+ exec >&2
+ AS_ERROR([failed to fetch branch $PSPP_BRANCH from $PSPP_REPO])
+fi
# Get PSPP commit number.
PSPP_COMMIT=`git rev-parse refs/builds/$BUILD_NUMBER/pspp`
:
else
# We don't have the right commit yet, update Gnulib.
- git fetch $GNULIB_REPO +refs/heads/*:refs/remotes/gnulib/*
+ if git fetch $GNULIB_REPO '+refs/heads/*:refs/remotes/gnulib/*'; then
+ :
+ else
+ exec >&2
+ AS_ERROR([failed to fetch commit $GNULIB_COMMIT from $GNULIB_REPO])
+ fi
fi
git update-ref refs/builds/$BUILD_NUMBER/gnulib $GNULIB_COMMIT
for base in gendocs.sh gendocs_template gendocs_template_min; do
cp "build-aux/$base" "$outdir/build-aux/"
done
+
+cat <<EOF
+OUTDIR='$outdir'
+BUILD_NUMBER='$BUILD_NUMBER'
+PSPP_REPO='$PSPP_REPO'
+PSPP_BRANCH='$PSPP_BRANCH'
+PSPP_COMMIT='$PSPP_COMMIT'
+GNULIB_COMMIT='$GNULIB_COMMIT'
+GNULIB_REPO='$GNULIB_REPO'
+EOF
if (my ($title) = /^## (.*) ##$/) {
$log_class = "step";
if (my ($name, $product) = $title =~ /^Saving(?:\s+([^:]*):)?\s+(.*)$/) {
- my $href = "$product/index.html";
+ my $href = "$product/summary.html";
$href = $product if ! -e $href;
my (%p);
push (@steps, \%s);
}
} else {
- if (my ($diagnostic) = /(error|warning):/i) {
+ my $diagnostic;
+ $diagnostic = "error" if /error:/i || /FAILED/;
+ $diagnostic = "warning" if /warning:/i;
+ if ($diagnostic) {
my (%d);
- $d{DIAGNOSTIC} = lc ($diagnostic);
+ $d{DIAGNOSTIC} = $diagnostic;
$d{MESSAGE} = $_;
$d{LN} = $ln;
}
}
push (@{$steps[$#steps]{CHILDREN}}, \%d);
-
- $log_class = "$diagnostic";
}
}
printf LOG_HTML "<a name=\"%d\"><tt>%4d</tt></a> ", $ln, $ln;
}
}
-open (INDEX, '>','index.html');
+open (INDEX, '>','summary.html');
print INDEX <<EOF;
<html>