autodist-cgi: increase default size of build output and support for full output

This commit is contained in:
Silvan Calarco 2024-04-13 14:10:42 +02:00
parent cebe696e6e
commit 5e4081a335

View File

@ -10,6 +10,7 @@ SHOWLOG=`echo "$QUERY_STRING" | sed -n 's/^.*SHOWLOG=\([^&]*\).*$/\1/p' | sed "s
SHOWINDEX=`echo "$QUERY_STRING" | sed -n 's/^.*SHOWINDEX=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` SHOWINDEX=`echo "$QUERY_STRING" | sed -n 's/^.*SHOWINDEX=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
LINES=`echo "$QUERY_STRING" | sed -n 's/^.*LINES=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` LINES=`echo "$QUERY_STRING" | sed -n 's/^.*LINES=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
FORMAT=`echo "$QUERY_STRING" | sed -n 's/^.*FORMAT=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` FORMAT=`echo "$QUERY_STRING" | sed -n 's/^.*FORMAT=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
FULL=`echo "$QUERY_STRING" | sed -n 's/^.*FULL=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
function resolve_logname() { function resolve_logname() {
local l=$1 local l=$1
@ -77,7 +78,7 @@ fi
[ ! "$SHOWLOG" -a "$HOST" = "$AS_HOST" ] && echo "<h2>Host: `hostname -s` (`uname -m`, kernel `uname -r`)</h2>" [ ! "$SHOWLOG" -a "$HOST" = "$AS_HOST" ] && echo "<h2>Host: `hostname -s` (`uname -m`, kernel `uname -r`)</h2>"
if [ "$SHOWLOG" -a "$HOST" != "$AS_HOST" ]; then if [ "$SHOWLOG" -a "$HOST" != "$AS_HOST" ]; then
curl "${AUTOPORT_CGI_HOST[$HOST]}?AS_HOST=$HOST&SHOWLOG=$SHOWLOG&NUM=$NUM&REP=$REP&LOG=$LOG" 2>/dev/null curl "${AUTOPORT_CGI_HOST[$HOST]}?AS_HOST=$HOST&SHOWLOG=$SHOWLOG&NUM=$NUM&REP=$REP&LOG=$LOG&FULL=$FULL" 2>/dev/null
else else
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
@ -176,12 +177,12 @@ _EOF
LOGFILESIZE=`stat -c %s ${BUILDLOGDIR}${SHOWLOG}` LOGFILESIZE=`stat -c %s ${BUILDLOGDIR}${SHOWLOG}`
LOGDATE=`stat -c %y ${BUILDLOGDIR}${SHOWLOG}` LOGDATE=`stat -c %y ${BUILDLOGDIR}${SHOWLOG}`
echo -n "<b>${SHOWLOG} ($LOGDATE; $LOGFILESIZE):</b>" echo -n "<b>${SHOWLOG} ($LOGDATE; $LOGFILESIZE):</b>"
if [ $LOGFILESIZE -lt 131072 ]; then if [ $LOGFILESIZE -lt 2097152 -o "$FULL" != "" ]; then
cat ${BUILDLOGDIR}${SHOWLOG} | parse_build_output cat ${BUILDLOGDIR}${SHOWLOG} | parse_build_output
else else
head -c 65535 ${BUILDLOGDIR}${SHOWLOG} | parse_build_output head -c 1048576 ${BUILDLOGDIR}${SHOWLOG} | parse_build_output
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) ------&gt;</font>" echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) ------&gt;</font>"
tail -c 65535 ${BUILDLOGDIR}${SHOWLOG} | parse_build_output tail -c 1048576 ${BUILDLOGDIR}${SHOWLOG} | parse_build_output
fi fi
fi fi
fi fi