If our error output is huge (> 5 MB) trim out the middle of the file.

The recent loop bugs have generated output that's too large to attach to
Bugzilla.

svn path=/trunk/; revision=45437
This commit is contained in:
Gerald Combs 2012-10-09 20:47:22 +00:00
parent cdd0915add
commit ff32bd8000
2 changed files with 18 additions and 0 deletions

View File

@ -198,6 +198,15 @@ function exit_error() {
echo -e "Processing failed. Capture info follows:\n"
echo " Input file: $CF"
ERR_SIZE=$(du -sk $TMP_DIR/$ERR_FILE | awk '{ print $1 }')
if [ $ERR_SIZE -ge 5000 ] ; then
mv $TMP_DIR/$ERR_FILE $TMP_DIR/${ERR_FILE}.full
head -n 2000 $TMP_DIR/${ERR_FILE}.full > $TMP_DIR/$ERR_FILE
echo -e "\n\n[ Output removed ]\n\n" >> $TMP_DIR/$ERR_FILE
tail -n 2000 $TMP_DIR/${ERR_FILE}.full >> $TMP_DIR/$ERR_FILE
rm -f $TMP_DIR/${ERR_FILE}.full
fi
if [ -d .svn ] ; then
echo -e "\nSubversion revision" >> $TMP_DIR/$ERR_FILE
svn log -l 1 >> $TMP_DIR/$ERR_FILE

View File

@ -89,6 +89,15 @@ function exit_error() {
echo -e "Processing failed. Capture info follows:\n"
echo " Input file: $CF"
ERR_SIZE=$(du -sk $TMP_DIR/$ERR_FILE | awk '{ print $1 }')
if [ $ERR_SIZE -ge 5000 ] ; then
mv $TMP_DIR/$ERR_FILE $TMP_DIR/${ERR_FILE}.full
head -n 2000 $TMP_DIR/${ERR_FILE}.full > $TMP_DIR/$ERR_FILE
echo -e "\n\n[ Output removed ]\n\n" >> $TMP_DIR/$ERR_FILE
tail -n 2000 $TMP_DIR/${ERR_FILE}.full >> $TMP_DIR/$ERR_FILE
rm -f $TMP_DIR/${ERR_FILE}.full
fi
if [ -d .svn ] ; then
echo -e "\nSubversion revision" >> $TMP_DIR/$ERR_FILE
svn log -l 1 >> $TMP_DIR/$ERR_FILE