autodist,webbuild: support for different update return codes in automatic updates logging

This commit is contained in:
Silvan Calarco 2013-06-05 14:03:56 +02:00
parent becb15708b
commit 24f394ce84
5 changed files with 31 additions and 15 deletions

View File

@ -548,7 +548,7 @@ function launch_pkgs_loop() {
case $SEVERITY in
0) ;;
1) echo "!! Error: spec filename must be the same as package name or invalid job name; skipping $pkg package."
[ "$do_autobuild" ] && autobuild_log $pkg $operation failed $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
[ "$do_autobuild" ] && autobuild_log $pkg $operation 240 $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
continue ;;
*) echo "!! Error: spec filename must be the same as package name or invalid job name; aborting."
exit 1 ;;
@ -565,7 +565,7 @@ function launch_pkgs_loop() {
case $SEVERITY in
0) ;;
1) echo "%! Error: could not apply patch to specfile; skipping $pkg package."
[ "$do_autobuild" ] && autobuild_log $pkg $operation failed $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
[ "$do_autobuild" ] && autobuild_log $pkg $operation 241 $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
ret=1
continue ;;
*) echo "!! Error: could not apply patch to specfile; aborting."
@ -756,7 +756,7 @@ function launch_pkgs_loop() {
}
mv $LOGFILE_PKG $LOGDIR/failed/
echo "?= See $LOGDIR/failed/${LOGFILE_PKG_NAME}"
[ "$do_autobuild" ] && autobuild_log $pkg $operation failed $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
[ "$do_autobuild" ] && autobuild_log $pkg $operation $ret $JOB_NAME $LOGDIR/failed/${LOGFILE_PKG_NAME}
case $operation in
autoupdate|update)
;;

View File

@ -235,7 +235,7 @@ _EOF
BUILDNOW[$BUILDNOWIDX]="$1"
[ "$4" ] && BUILDLOG[$BUILDNOWIDX]="${BUILDLOG[$BUILDNOWIDX]} `echo $4 | sed "s|.*autodist/log/||"`"
# BUILDLOG[$BUILDNOWIDX]="${BUILDLOG[$BUILDNOWIDX]} $2/$3/$1.i586"
BUILDNOWSTATUS[$BUILDNOWIDX]=
BUILDNOWSTATUS[$BUILDNOWIDX]=$3
BUILDNOWIDX=`expr $BUILDNOWIDX + 1`
done < $STATEFILE
else
@ -266,7 +266,7 @@ _EOF
BUILDLOG[$BUILDNOWIDX]="${BUILDLOG[$BUILDNOWIDX]} $CURRLOGFILE"
fi
# BUILDLOG[$BUILDNOWIDX]="${BUILDLOG[$BUILDNOWIDX]} $2/$3/$1.i586"
BUILDNOWSTATUS[$BUILDNOWIDX]=
BUILDNOWSTATUS[$BUILDNOWIDX]=$3
BUILDNOWIDX=`expr $BUILDNOWIDX + 1`
done < $AUTODISTSTATEFILE
for p in `dirname $LOGFILE`/current.*; do
@ -310,10 +310,21 @@ _EOF
build-ok|send-ok|install-ok|retryinstall-ok)
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\">$OPERATIONNAME:$OPERATIONSTATUS</a>"
;;
*-failed)
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=red>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
update-failed|autoupdate-failed)
if [ "${BUILDNOWSTATUS[$b]}" = "4" ]; then
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=green>$OPERATIONNAME:up-to-date</font></a>"
elif [ "${BUILDNOWSTATUS[$b]}" = "3" ]; then
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=darkgoldenrod>$OPERATIONNAME:unknown</font></a>"
elif [ "${BUILDNOWSTATUS[$b]}" = "2" ]; then
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=darkgoldenrod>$OPERATIONNAME:newer</font></a>"
else
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=red>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
fi
;;
*) echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=black>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
*-ok) echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=black>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
;;
*)
echo -n "<a target=_autodist href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=red>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
;;
esac
# [ "$SUBJOBNAME" != "$JOBNAME" ] && echo -en "(<a href=\"/distribution/webbuild.php?ENVIRONMENT=$i&PACKAGE=$SUBJOBNAME\" target=\"webbuild\">$SUBJOBNAME</a>)"
@ -324,7 +335,6 @@ _EOF
if [[ $b -eq $BUILDNOWIDX-1 && ! "$ENDTIME" ]]; then
echo -n "<font color=green>${BUILDOPERATION[$b]}(in progress...)</font>"
fi
[ "${BUILDNOWSTATUS[$b]}" ] && echo -n "<i>(${BUILDNOWSTATUS[$b]})</i>"
LASTJOBNAME=$JOBNAME
done
[ "$LASTJOBNAME" ] && echo

View File

@ -672,7 +672,7 @@ else
[ "$STATE_AUTODISTCURRENT" = "1" ] && AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-current || AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-last
while read line; do
set -- $line
if [ "$3" = "failed" -a "$2" != "autoupdate" ]; then
if [ "$3" != "ok" ]; then
if [ "$REQUEST" != "skip" ]; then
[ "$PACKAGE" = "$1" ] && SELECTED="selected=selected" || SELECTED=
else
@ -681,7 +681,13 @@ else
NEXTLOGTYPE=$2
}
fi
echo -n "<option value=\"$1;$2\" $SELECTED>$1 ($2 $3)</option>"
# skip 'higher version' (2), 'cant' find update' (3)
# 'no updates available' (4) autospec return codes
if [ "$2-$3" != "update-2" -a "$2-$3" != "autoupdate-2" -a \
"$2-$3" != "update-3" -a "$2-$3" != "autoupdate-3" -a \
"$2-$3" != "update-4" -a "$2-$3" != "autoupdate-4" ]; then
echo -n "<option value=\"$1;$2\" $SELECTED>$1 ($2)</option>"
fi
if [ "$PACKAGE" = "$1" -a "$REQUEST" = "skip" ]; then
SELECTED="selected=selected"
else
@ -1296,7 +1302,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')"
echo -n ",\"`cgi_encodevar "Send <b>$PACKAGE</b> built packages to <b>"`\"+getSelectedValueById('sendrepository')+"
echo -n "\"`cgi_encodevar "</b>?<br><br><font color=lightgreen>HINT: does summary look short and good?</font><br><b>${SPECVAR_Name[0]} - ${SPECVAR_Summary[0]}.</b>"`\""
echo -n "\"`cgi_encodevar "</b>?<br><br><font color=goldenrod>HINT: does summary look short and good?</font><br><b>${SPECVAR_Name[0]} - ${SPECVAR_Summary[0]}.</b>"`\""
echo -n "); class=redbutton $HREFADD>"
# recreate and send SRPM
if [ "$SPECVAR_CHECK_NOAUTOBUILDREQ" ]; then

View File

@ -88,7 +88,7 @@ function cgi_get_POST_vars()
cgi_get_POST_upload "${CONTENT_TYPE/*boundary=}"
return
fi
[ "${CONTENT_TYPE}" != "application/x-www-form-urlencoded" ] && \
[ "${CONTENT_TYPE:0:33}" != "application/x-www-form-urlencoded" ] && \
echo "Warning: you should probably use MIME type "\
"application/x-www-form-urlencoded instead of ${CONTENT_TYPE}!" 1>&2
# save POST variables (only first time this is called)

View File

@ -54,7 +54,7 @@ elif [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then
SUCMDPREFIX="chroot $ENVPREFIX su -l ${AUTOPORT_CHROOT_USER[$ENVIRONMENT]} -c"
[ "$TMPFILE" ] && {
cp $TMPFILE /var/autoport/${AUTOPORT_CHROOT[$ENVIRONMENT]}/$TMPFILE
chmod 755 /var/autoport/${AUTOPORT_CHROOT[$ENVIRONMENT]}/$TMPFILE
chmod +r /var/autoport/${AUTOPORT_CHROOT[$ENVIRONMENT]}/$TMPFILE
}
elif [ "${AUTOPORT_NATIVE[$ENVIRONMENT]}" ]; then
ENVPREFIX=