# HG changeset patch # User Mark Wielaard # Date 1332327821 -3600 # Node ID 93e227921517a050db650a8cbb86844a026bf09f # Parent 1e60d0136e995b6cc2a3f858a8dbe0fa6ec5e779 Make build.sh (old builder) handle 6, 7 or trunk icedtea builds. diff -r 1e60d0136e99 -r 93e227921517 icedtea/build.sh --- a/icedtea/build.sh Thu Jan 26 12:43:56 2012 +0100 +++ b/icedtea/build.sh Wed Mar 21 12:03:41 2012 +0100 @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2009, 2010, Mark J. Wielaard +# Copyright (C) 2009, 2010, 2012, Mark J. Wielaard # This IcedTea build script 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 3 of the @@ -13,7 +13,9 @@ # # Currently being run on builder.classpath.org with: # while true; do time ./build.sh 6; date; sleep 600; \ -# time ./build.sh 7; date; sleep 600; done 2>&1 | tee build.log +# time ./build.sh 7; date; sleep 600; \ +# time ./build.sh trunk; date; sleep 600; done 2>&1 \ +# | tee build.log # Where to send error reports, add committers later. EMAIL="testresults@icedtea.classpath.org" @@ -22,19 +24,27 @@ # http://www.davidpashley.com/articles/writing-robust-shell-scripts.html if [ $# -ne 1 ]; then - echo "build.sh takes one argument 6 or 7" + echo "build.sh takes one argument 6, 7 or trunk" exit -1; -elif [ "$1" != "6" -a "$1" != "7" ]; then - echo "build.sh argument must be 6 or 7" +elif [ "$1" != "6" -a "$1" != "7" -a "$1" != trunk ]; then + echo "build.sh argument must be 6, 7 or trunk" exit -1; fi +# Add dash (-) in case of trunk to version string, to make file/dir names +# more readable. +if [ "$1" == "trunk" ]; then + VERSIONSTR="-trunk" +else + VERSIONSTR="$1" +fi + BASE_BUILD_DIR=/usr/local/build -ICEDTEA_DIR=$BASE_BUILD_DIR/icedtea$1 -ICEDTEA_BUILD_DIR=$BASE_BUILD_DIR/icedtea$1-build +ICEDTEA_DIR=$BASE_BUILD_DIR/icedtea${VERSIONSTR} +ICEDTEA_BUILD_DIR=$BASE_BUILD_DIR/icedtea${VERSIONSTR}-build # Build artifacts, sources and test results will be stored here. -RESULTS_DIR=/usr/local/build/results/icedtea$1 +RESULTS_DIR=/usr/local/build/results/icedtea${VERSIONSTR} echo "Building $ICEDTEA_DIR" echo " in $ICEDTEA_BUILD_DIR" @@ -77,8 +87,8 @@ EMAIL="$EMAIL $USERS" # Announce the test build coming up. -#(echo -n "Doing a test build for IcedTea$1"; echo; echo "$CHANGES") \ -# | mail -s "IcedTea$1 build testing for $HG_CURRENT_ID" $EMAIL +#(echo -n "Doing a test build for IcedTea${VERSIONSTR}"; echo; echo "$CHANGES") \ +# | mail -s "IcedTea${VERSIONSTR} build testing for $HG_CURRENT_ID" $EMAIL # Remove both 6 and 7, there is only disk space for one build #echo "Removing old builds $BASE_BUILD_DIR/icedtea6-build $BASE_BUILD_DIR/icedtea7-build..." @@ -94,17 +104,17 @@ SOURCES_DIR=$RESULTS_DIR/src cp -r $SOURCES_DIR/*.tar.* $SOURCES_DIR/drops $ICEDTEA_BUILD_DIR/ -BUILD_LOG_FILE=$BASE_BUILD_DIR/build-icedtea$1.log +BUILD_LOG_FILE=$BASE_BUILD_DIR/build-icedtea${VERSIONSTR}.log echo "Putting build log in $BUILD_LOG_FILE" # Make sure a failure in any command in a pipe, fails the whole pipe command. set -o pipefail # Some additional VMs only build against one or the other version. -if [ "$1" == "6"]; then +if [ "${VERSIONSTR}" == "6"]; then ICEDTEA_ADDITIONAL_VMS="cacao,jamvm,shark" ADDITIONAL_OPTIONS="" -elif [ "$1" == "7" ]; then +elif [ "${VERSIONSTR}" == "7" ]; then ICEDTEA_ADDITIONAL_VMS="shark" ADDITIONAL_OPTIONS="--disable-system-lcms" fi @@ -127,10 +137,10 @@ # store the full build log and config.log file cp $ICEDTEA_BUILD_DIR/config.log $BUILD_LOG_FILE $RESULTS_DIR/ -RESULTS_URL="http://builder.wildebeest.org/icedtea/icedtea$1/" +RESULTS_URL="http://builder.wildebeest.org/icedtea/icedtea${VERSIONSTR}/" if [ $BUILD_RESULT -ne 0 ]; then - (echo "The current IcedTea$i build fails."; \ + (echo "The current IcedTea${VERSIONSTR} build fails."; \ echo; \ echo "More info at $RESULTS_URL"; \ echo; \ @@ -140,7 +150,7 @@ echo; echo; \ echo "Last part of build log: "; echo; \ tail -160 $BUILD_LOG_FILE) \ - | mail -s "IcedTea$1 build failed for $HG_CURRENT_ID" $EMAIL + | mail -s "IcedTea${VERSIONSTR} build failed for $HG_CURRENT_ID" $EMAIL exit -1 fi @@ -156,7 +166,7 @@ echo "Test results compare: $TEST_RESULT" if [ $TEST_RESULT -ne 0 ]; then - (echo "The current IcedTea$i build test results changed."; \ + (echo "The current IcedTea${VERSIONSTR} build test results changed."; \ echo; \ echo "Changed test results: "; echo; \ diff -u $TESTS_DIR/jtreg-summary.log \ @@ -167,24 +177,24 @@ echo "Possibly, but not necessarily, because of one of these changes:"; \ echo; \ echo "$CHANGES") \ - | mail -s "IcedTea$1 test results changed for $HG_CURRENT_ID" $EMAIL; + | mail -s "IcedTea${VERSIONSTR} test results changed for $HG_CURRENT_ID" $EMAIL; else - (echo "The current IcedTea$i build succeeded, no changes in test results."; \ + (echo "The current IcedTea${VERSIONSTR} build succeeded, no changes in test results."; \ echo; \ echo "More info at $RESULTS_URL"; \ echo; \ echo "New changes since last time:"; \ echo; \ echo "$CHANGES") \ - | mail -s "IcedTea$1 build succeeded for $HG_CURRENT_ID" $EMAIL; + | mail -s "IcedTea${VERSIONSTR} build succeeded for $HG_CURRENT_ID" $EMAIL; fi # Need to fixup jtreg report html files. # Escape paths for sed. # From path is absolute build path on (chrooted) file system. # To path is absolute (prefix) path on webserver. -FROM_PATH="\/usr\/local\/build\/icedtea$1-build\/test\/" -TO_PATH="\/icedtea\/icedtea$1\/test\/" +FROM_PATH="\/usr\/local\/build\/icedtea${VERSIONSTR}-build\/test\/" +TO_PATH="\/icedtea\/icedtea${VERSIONSTR}\/test\/" for i in `find $ICEDTEA_BUILD_DIR/test/*/JTreport -name \*.html`; do \ sed -i "s/$FROM_PATH/$TO_PATH/" $i; \ done @@ -211,5 +221,5 @@ cp -r $ICEDTEA_BUILD_DIR/*.tar.* $ICEDTEA_BUILD_DIR/drops $SOURCES_DIR/ # And the actual icedtea sources used. -rm -f $SOURCES_DIR/icedtea$1.tar.gz -cd $ICEDTEA_DIR && hg archive --type tgz $SOURCES_DIR/icedtea$1.tar.gz +rm -f $SOURCES_DIR/icedtea${VERSIONSTR}.tar.gz +cd $ICEDTEA_DIR && hg archive --type tgz $SOURCES_DIR/icedtea${VERSIONSTR}.tar.gz