#!/bin/bash # Call this indirectly by something like this - # /path/to/easy_e17.sh --conf=/path/to/NIGHTLY_BUILD.conf --cvspath=/path/to/cvs --postscript=/path/to/this/script --instpath=/path/to/install/to # A cron job is a good place for it. # Edit this to suit your setup. www_path="/var/www/download/tests" www_url="http://download.enlightenment.org/tests" from_email="noreply@enlightenment.org" #to_mail="enlightenment-cvs@lists.sourceforge.net" to_mail="onefang@gmail.com" reply_to="enlightenment-devel@lists.sourceforge.net" tmp_path="/tmp/easy_e17" logs_path="$tmp_path/install_logs" # Copy logs. rm -f $www_path/logs/* mkdir -p $www_path/logs cp $logs_path/* $www_path/logs cp $tmp_path/cvs_update.log $www_path/logs # Figure out what happened to each package. for file in $logs_path/*.log ; do package=`basename "$file" | cut -d'.' -f1` if [ -e "$tmp_path/$package.installed" ]; then packages_installed="$packages_installed $package" else if [ -e "$tmp_path/$package.skipped" ]; then packages_skipped="$packages_skipped $package" else if [ -e "$tmp_path/$package.nobuild" ]; then packages_nobuild="$packages_nobuild $package" else packages_failed="$packages_failed $package" fi fi fi done # Email summary and notes. OUR_TEMP=$www_path/LAST_EMAIL.txt echo "To: $to_mail" >$OUR_TEMP echo "Reply-To: $reply_to" >>$OUR_TEMP echo -n "Subject: Nightly build log for E17 on `date '+%F %T %z'`" >>$OUR_TEMP if [ -z "$packages_failed" ]; then echo -n " - NO ERRORS" >>$OUR_TEMP fi echo "" >>$OUR_TEMP echo "From: Nightly build system <$from_email>" >>$OUR_TEMP echo "" >>$OUR_TEMP # Dump the summary information. echo "Build log for Enlightenment DR 0.17 on `date '+%F %T %z'`" >>$OUR_TEMP echo "Build logs are available at $www_url/logs" >>$OUR_TEMP echo >>$OUR_TEMP echo "Packages that failed to build:" >>$OUR_TEMP for package in $packages_failed; do echo "$package $www_url/logs/$package.log" >>$OUR_TEMP # echo -n "COMMAND: " >>$OUR_TEMP # grep "^EASY_E17 CMD: " $logs_path/$package.log | tail -n 1 | cut -b 14- >>$OUR_TEMP done echo >>$OUR_TEMP echo "Packages with no supported build system:" >>$OUR_TEMP line_length=0 for package in $packages_nobuild; do len=${#package} echo -n "$package, " >>$OUR_TEMP line_length=`expr $line_length + $len + 2` if [ $line_length -ge 72 ]; then line_length=0 echo >>$OUR_TEMP fi done echo >>$OUR_TEMP echo >>$OUR_TEMP echo "Packages skipped:" >>$OUR_TEMP line_length=0 for package in $packages_skipped; do len=${#package} echo -n "$package, " >>$OUR_TEMP line_length=`expr $line_length + $len + 2` if [ $line_length -ge 72 ]; then line_length=0 echo >>$OUR_TEMP fi done echo >>$OUR_TEMP echo >>$OUR_TEMP echo "Packages that build OK:" >>$OUR_TEMP line_length=0 for package in $packages_installed; do len=${#package} echo -n "$package, " >>$OUR_TEMP line_length=`expr $line_length + $len + 2` if [ $line_length -ge 72 ]; then line_length=0 echo >>$OUR_TEMP fi done echo >>$OUR_TEMP echo >>$OUR_TEMP # Dump some useful info about tho build environment. cat /etc/issue >>$OUR_TEMP uname -a >>$OUR_TEMP echo >>$OUR_TEMP #autoconf --version | head -n 1 >>$OUR_TEMP #automake --version | head -n 1 >>$OUR_TEMP #libtool --version | head -n 1 >>$OUR_TEMP #gettext --version | head -n 1 >>$OUR_TEMP # Dump the notes, edit this to suit. cat - >>$OUR_TEMP <