Skip to content
Snippets Groups Projects
Commit eed0b4b6 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Limit the size of the output from check_glsa.

parent 921e67bf
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,10 @@ case $RC in ...@@ -36,8 +36,10 @@ case $RC in
echo -n "CRITICAL - glsa-check found $problems problems affecting " echo -n "CRITICAL - glsa-check found $problems problems affecting "
sort < $PACKAGE_TMP \ sort < $PACKAGE_TMP \
|uniq \ |uniq \
|awk 'NR > 1 { printf ", " } |awk 'BEGIN { sz = 0 }
{ printf $0 } ' \ NR > 1 && sz < 198 { printf ", "; sz += 2 }
sz < 200 { printf $0; sz += length($0) }
END { if (sz >= 200) printf ", others" } ' \
|sed 's/, \([^,]*\)$/ and \1/' |sed 's/, \([^,]*\)$/ and \1/'
echo ". | problems=$problems, packages=`sort $PACKAGE_TMP|uniq|wc -l`" echo ". | problems=$problems, packages=`sort $PACKAGE_TMP|uniq|wc -l`"
exit 2;; exit 2;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment