as released as part of build91 build2
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 10 Jun 2010 19:28:57 +0000 (12:28 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 10 Jun 2010 19:28:57 +0000 (12:28 -0700)
build-pspp.m4
make-bin-dist.as
make-builder.as
results2html

index c346d4d557a04c988c6dde1649a48584ccb45cb0..8a672ad4bf56a0927368e0136e26073e73de387a 100644 (file)
@@ -74,7 +74,7 @@ AS_ECHO(["    $1=$[$1]"])])
 # BP_OUTPUT(DESCRIPTION, FILE)
 m4_define([BP_OUTPUT],
 [_bp_basename=`AS_BASENAME([$2])`
-BP_START_STEP([Saving $_bp_basename: $1])])
+BP_START_STEP([Saving $1: $_bp_basename])])
 
 # BP_MOVE_OUTPUT(DESCRIPTION, FILE)
 m4_define([BP_MOVE_OUTPUT],
index 40d20bac474289756dab02db47504b992dcd2172..113fe4943aeb0f6e012f02ae4c9eb0e6172b757f 100644 (file)
@@ -1,4 +1,4 @@
-# -* autoconf -*-
+# -*- autoconf -*-
 
 BP_INIT
 
@@ -39,6 +39,7 @@ overwrite=false
 remote=
 CONFIGUREFLAGS=
 n_envvars=0
+check=true
 
 # Parse command line.
 while test $# -gt 0 ; do
@@ -72,6 +73,10 @@ while test $# -gt 0 ; do
        CONFIGUREFLAGS=$2
        shift; shift ;;
 
+    --no-check )
+       check=false
+       shift ;;
+
     -- )     # Stop option processing
        shift; break ;;
     -* )
@@ -102,6 +107,13 @@ if test ! -e "$tarball"; then
    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 # (
@@ -128,13 +140,14 @@ if test "X$REMOTE_HOST" != X; then
   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
 
@@ -144,15 +157,18 @@ if test "X$REMOTE_HOST" != X; then
   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])
@@ -175,16 +191,33 @@ if test X$DIST_DIR = X; then
 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
@@ -195,46 +228,50 @@ while test $i -lt $n_envvars; do
 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
 
index e7fd623a5f6658c8439869cf868474823ce048d6..5eceb5fb1f0088983e6d0b784a8189cc6b2222f5 100644 (file)
@@ -159,10 +159,20 @@ esac
 # 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`
@@ -178,7 +188,12 @@ if git rev-parse --verify --quiet $GNULIB_COMMIT^0 > /dev/null; then
     :
 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
 
@@ -215,3 +230,13 @@ mkdir "$outdir/build-aux"
 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
index c682b5e514cf9755c60c36eb2155d0b9aed5ce98..9c73d12e31ef3d380297c551c4da14b48129958a 100755 (executable)
@@ -56,7 +56,7 @@ while (<LOG>) {
     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);
@@ -88,9 +88,12 @@ while (<LOG>) {
            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;
 
@@ -120,8 +123,6 @@ while (<LOG>) {
                }
            }
            push (@{$steps[$#steps]{CHILDREN}}, \%d);
-
-           $log_class = "$diagnostic";
        }
     }
     printf LOG_HTML "<a name=\"%d\"><tt>%4d</tt></a>  ", $ln, $ln;
@@ -132,7 +133,7 @@ while (<LOG>) {
     }
 }
 
-open (INDEX, '>','index.html');
+open (INDEX, '>','summary.html');
 
 print INDEX <<EOF;
 <html>