From 6375aede61d57422ad82f4941693493c07b78aa2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 20 Aug 2011 10:49:35 +0100 Subject: [PATCH] New autobuild script. Remove the old top-level autobuild.sh that confused a lot of people. Add an autobuild.sh script that builds from the latest tarball. --- autobuild.sh | 96 --------------------------------------- contrib/README | 4 ++ contrib/autobuild/autobuild.sh | 100 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 96 deletions(-) delete mode 100755 autobuild.sh create mode 100755 contrib/autobuild/autobuild.sh diff --git a/autobuild.sh b/autobuild.sh deleted file mode 100755 index 77068c8..0000000 --- a/autobuild.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - - -PROJECT=libguestfs -FEBOOTSTRAP_PATH=$HOME/d/febootstrap -MAILTO=libguestfs@redhat.com -HOSTNAME="$(hostname -s)" - -#---------------------------------------------------------------------- -# Helper functions. - -failed () -{ - mail -s "$HOSTNAME $PROJECT FAILED $1 $gitsha" $MAILTO < local-log -} - -ok () -{ - mail -s "$HOSTNAME $PROJECT success $gitsha" $MAILTO < local-log -} - -#---------------------------------------------------------------------- - -set -e -set -x - -# Make sure we build and test against latest febootstrap. -PATH=$FEBOOTSTRAP_PATH:$FEBOOTSTRAP_PATH/helper:$PATH - -# Remove any old cache directories. -rm -rf /tmp/guestfs.* ||: - -rm -f local-log -cat > local-log <> local-log 2>&1 - -# Pull from the public repo so that we don't need ssh-agent. -git pull --rebase git://git.annexia.org/git/libguestfs.git master -git clean -d -f - -# The git version we are building. -gitsha=$(git log|head -1|awk '{print $2}') - -# Do the configure step. -./bootstrap ||: -./autogen.sh --enable-gcc-warnings || { - failed "configure step" - exit 1 -} - -make clean ||: - -# Do the build step. -make || { - failed "build step" - exit 1 -} - -# Tests that are skipped (note that these tests should be fixed). -case "$HOSTNAME" in - builder-ubuntu) - # get_e2uuid: /dev/vdc: [no error message] - # get_e2label: /dev/vda1: [no error message] - # Diagnosis: either mkjournal is not writing a UUID or blkid is - # unable to pick it up. - export SKIP_TEST_GET_E2UUID=1 - export SKIP_TEST_SET_E2UUID=1 - export SKIP_TEST_SET_E2LABEL=1 - - # Avoids: - # device-mapper: ioctl: unable to remove open device temporary-cryptsetup-661 - # device-mapper: remove ioctl failed: Device or resource busy - # guestfsd: error: Device lukstest is busy. - # Diagnosis: appears to be a bug in cryptsetup on Ubuntu. - # https://bugzilla.redhat.com/show_bug.cgi?id=527056 - export SKIP_TEST_LUKS_SH=1 - ;; -esac - -# Run the tests. -make check || { - failed "tests" - exit 1 -} - -ok diff --git a/contrib/README b/contrib/README index 7050241..ce695ec 100644 --- a/contrib/README +++ b/contrib/README @@ -1,6 +1,10 @@ Random contributions and things which don't fit in anywhere else ---------------------------------------------------------------------- +autobuild/ + The autobuild script that we use to build and test the + tarballs on Debian and elsewhere. + centos5.3-libguestfs.spec [REMOVED] This used to be a centos5.3 specfile. Please use the specfile diff --git a/contrib/autobuild/autobuild.sh b/contrib/autobuild/autobuild.sh new file mode 100755 index 0000000..6ec1bfc --- /dev/null +++ b/contrib/autobuild/autobuild.sh @@ -0,0 +1,100 @@ +#!/bin/bash - +# libguestfs autobuild script +# Copyright (C) 2009-2011 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# This script is used to download and test the latest tarball on +# Debian and other platforms. It runs from a cron job and sends email +# to the mailing list about the status. + +set -e + +# Subject line of email prefix. +prefix="${1:-[autobuild]}" + +# Where we send mail. +mailto="rjones@redhat.com" + +# Move to temporary directory for building. +tmpdir="$(mktemp -d --tmpdir=/var/tmp)" +cd "$tmpdir" + +# The libguestfs index page contains some hidden fields to help us +# find the latest version programmatically. +version=$(wget --no-cache -O- -q http://libguestfs.org | + grep '^LATEST-VERSION:' | awk '{print $2}') +url=$(wget --no-cache -O- -q http://libguestfs.org | + grep '^LATEST-URL:' | awk '{print $2}') +filename=$(basename "$url") +directory=$(basename "$url" .tar.gz) + +echo "--------------------------------------------------" +echo "prefix $prefix" +echo "libguestfs $version" +echo "url $url" +echo "build dir $tmpdir/$directory" +echo "--------------------------------------------------" + +# Grab the latest tarball from upstream. +wget "$url" + +# Unpack the tarball. +tar zxf "$filename" + +# Enter directory. +cd "$directory" + +# This function is called if any step fails. +failed () +{ + mutt -s "$prefix libguestfs $version FAILED $1" "$mailto" -a ../build.log < ../build.log 2>&1 || { + failed "configure" + exit 1 +} +echo "make" +make >> ../build.log 2>&1 || { + failed "make" + exit 1 +} + +# Run the tests. +echo "make check" +make check >> ../build.log 2>&1 || { + failed "make check" + exit 1 +} + +echo "finished" +ok -- 1.8.3.1