webbuild: increase logs size before cutting; cache environment info, update every 5 minutes

This commit is contained in:
Silvan Calarco 2014-09-21 02:34:47 +02:00
parent 73791f2c58
commit 60f8e3cff0

View File

@ -59,7 +59,7 @@ function showlog() {
tail -n +0 -f $f --pid $PROCESSPID | stdbuf -oL sed "s|<|\&lt;|g"
echo -n "<!-- ENDSCROLL -->"
else
if [ $LOGFILESIZE -lt 524288 ]; then
if [ $LOGFILESIZE -lt 2097152 ]; then
if [ -r $f ]; then
cat $f | parse_build_output $PACKAGE
else
@ -67,13 +67,13 @@ function showlog() {
fi
else
if [ -r $f ]; then
head -c 262144 $f | parse_build_output $PACKAGE
head -c 1048576 $f | parse_build_output $PACKAGE
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) -------&gt;</font>"
tail -c 262144 $f | parse_build_output $PACKAGE
tail -c 1048576 $f | parse_build_output $PACKAGE
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 262144 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 1048576 $f" | parse_build_output $PACKAGE
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) -------&gt;</font>"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "tail -c 262144 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "tail -c 1048576 $f" | parse_build_output $PACKAGE
fi
fi
fi
@ -108,10 +108,18 @@ function showEnvironmentPanel() {
# toolchain
echo -n "<br>"
local toolchain_output=`LANGUAGE=C $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "gcc --version | head -n1; LANGUAGE=C ld -v"`
local gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
echo "Toolchain: gcc $gcc_ver, $binutils_ver"
if [ ! -e $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data -o \
"`find $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data -mmin +5`" ]; then
local toolchain_output=`LANGUAGE=C $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "gcc --version | head -n1; LANGUAGE=C clang -v | head -n1; LANGUAGE=C ld -v"`
local gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
local clang_ver=`echo $toolchain_output | sed "s|.*clang version \([0-9.]*\) .*|\1|"`
local toolchain_text="gcc $gcc_ver, clang $clang_ver, $binutils_ver"
echo "$toolchain_text" > $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data
else
local toolchain_text=`cat $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data`
fi
echo "Toolchain: $toolchain_text"
# system upgrade
echo -n "<br><input type=button id=smartupgrade value=\"system upgrade\" onclick="