cookutils rev 586 slitaz-tank
cook: Add loglimit function.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Fri Feb 08 03:25:37 2013 +0000 (2013-02-08) |
parents | 3c62961c30e1 |
children | 156eb61b493b |
files | cook cook.conf |
line diff
1.1 --- a/cook Fri Feb 01 23:49:02 2013 +0000 1.2 +++ b/cook Fri Feb 08 03:25:37 2013 +0000 1.3 @@ -1110,7 +1110,12 @@ 1.4 EOT 1.5 } 1.6 1.7 - 1.8 +# Truncate stdout log file to $1 Mb 1.9 +loglimit() 1.10 +{ 1.11 + [ -n "$DEFAULT_LOG_LIMIT" ] || return 1.12 + tee /dev/stderr | dd bs=1024k count=${1:-$DEFAULT_LOG_LIMIT} 2> /dev/null 1.13 +} 1.14 1.15 # 1.16 # Commands 1.17 @@ -1665,13 +1670,13 @@ 1.18 fi 1.19 1.20 # Cook and pack or exit on error and log everything. 1.21 - cookit $@ 2>&1 | tee $LOGS/$pkg.log 1.22 + cookit $@ 2>&1 | loglimit 50 > $LOGS/$pkg.log 1.23 remove_deps | tee -a $LOGS/$pkg.log 1.24 if [ "$CLEAN_CHROOT" ]; then 1.25 clean_chroot | tee -a $LOGS/$pkg.log 1.26 fi 1.27 cookit_quality 1.28 - packit 2>&1 | tee -a $LOGS/$pkg.log 1.29 + packit 2>&1 | loglimit 5 >> $LOGS/$pkg.log 1.30 clean_log 1.31 1.32 # Exit if any error in packing.
2.1 --- a/cook.conf Fri Feb 01 23:49:02 2013 +0000 2.2 +++ b/cook.conf Fri Feb 08 03:25:37 2013 +0000 2.3 @@ -187,3 +187,6 @@ 2.4 # Old way/tazwok compatibility. 2.5 BUILD_HOST="$HOST_SYSTEM" 2.6 SOURCES_REPOSITORY=$SRC 2.7 + 2.8 +# Maximum log size in MB per receipt function call (unset it to disable) 2.9 +DEFAULT_LOG_LIMIT=50