# HG changeset patch # User Christopher Rogers # Date 1360293937 0 # Node ID 99372fa1d17e00e8f3b87f5dd2ebcd9b131cfcae # Parent 3c62961c30e1475a1ea60d6941347a33058fbcfe cook: Add loglimit function. diff -r 3c62961c30e1 -r 99372fa1d17e cook --- a/cook Fri Feb 01 23:49:02 2013 +0000 +++ b/cook Fri Feb 08 03:25:37 2013 +0000 @@ -1110,7 +1110,12 @@ EOT } - +# Truncate stdout log file to $1 Mb +loglimit() +{ + [ -n "$DEFAULT_LOG_LIMIT" ] || return + tee /dev/stderr | dd bs=1024k count=${1:-$DEFAULT_LOG_LIMIT} 2> /dev/null +} # # Commands @@ -1665,13 +1670,13 @@ fi # Cook and pack or exit on error and log everything. - cookit $@ 2>&1 | tee $LOGS/$pkg.log + cookit $@ 2>&1 | loglimit 50 > $LOGS/$pkg.log remove_deps | tee -a $LOGS/$pkg.log if [ "$CLEAN_CHROOT" ]; then clean_chroot | tee -a $LOGS/$pkg.log fi cookit_quality - packit 2>&1 | tee -a $LOGS/$pkg.log + packit 2>&1 | loglimit 5 >> $LOGS/$pkg.log clean_log # Exit if any error in packing. diff -r 3c62961c30e1 -r 99372fa1d17e cook.conf --- a/cook.conf Fri Feb 01 23:49:02 2013 +0000 +++ b/cook.conf Fri Feb 08 03:25:37 2013 +0000 @@ -187,3 +187,6 @@ # Old way/tazwok compatibility. BUILD_HOST="$HOST_SYSTEM" SOURCES_REPOSITORY=$SRC + +# Maximum log size in MB per receipt function call (unset it to disable) +DEFAULT_LOG_LIMIT=50