cookutils rev 576
limit log size, not stdout
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jan 30 08:49:07 2013 +0100 (2013-01-30) |
parents | 82cddb19751c |
children | 1a00b5242294 |
files | cook |
line diff
1.1 --- a/cook Tue Jan 29 23:02:16 2013 +0100 1.2 +++ b/cook Wed Jan 30 08:49:07 2013 +0100 1.3 @@ -891,6 +891,12 @@ 1.4 EOT 1.5 } 1.6 1.7 +# Truncate stdout log file to $1 Mb. 1.8 +loglimit() 1.9 +{ 1.10 + tee /dev/stderr | dd bs=1024k count=${1:-50} 2> /dev/null 1.11 +} 1.12 + 1.13 # 1.14 # Commands 1.15 # 1.16 @@ -1343,10 +1349,10 @@ 1.17 done 1.18 1.19 # Cook and pack or exit on error and log everything. 1.20 - cookit $@ 2>&1 | dd bs=1024k count=50 | tee $LOGS/$pkg.log 1.21 + cookit $@ 2>&1 | loglimit 50 > $LOGS/$pkg.log 1.22 remove_deps | tee -a $LOGS/$pkg.log 1.23 cookit_quality 1.24 - packit 2>&1 | dd bs=1024k count=5 |tee -a $LOGS/$pkg.log 1.25 + packit 2>&1 | loglimit 5 >> $LOGS/$pkg.log 1.26 clean_log 1.27 1.28 # Exit if any error in packing.