autodist-cgi: add packages links to webbuild page

This commit is contained in:
Silvan Calarco 2012-09-02 13:21:18 +02:00
parent b36a8a552e
commit a518dbe02a

View File

@ -114,7 +114,7 @@ _EOF
[ "${SHOWLOG/\/\.}" != "${SHOWLOG}" ] && continue
if [ "${AUTOPORT_CHROOT[$i]}" ]; then
BUILDLOGDIR="/var/autoport/${AUTOPORT_CHROOT[$i]}/home/${AUTOPORT_CHROOT_USER[$i]}/.autodist/log/"
elif [ "${AUTOPORT_NATIVE[$i]}" -o "${AUTOPORT_UPDATE[$i]}" ]; then
elif [ "${AUTOPORT_NATIVE[$i]}" -o "${AUTOPORT_UPDATE[$i]}" ]; then
BUILDLOGDIR="/var/autodist/log/"
fi
if [ "${SHOWLOG/\/ok\/}" != "${SHOWLOG}" -o "${SHOWLOG/\failed\/}" != "${SHOWLOG}" ]; then
@ -259,13 +259,14 @@ _EOF
# set -- ${BUILDNOW[$b]}
JOBNAME=${BUILDNOW[$b]}
[ "$JOBNAME" ] || continue
echo -n "<b>$JOBNAME</b>: "
echo -n "<a href=\"/distribution/webbuild.php?ENVIRONMENT=$i&PACKAGE=$JOBNAME\" target=\"webbuild\"><b>$JOBNAME</b></a>: "
rowcnt=0
if [ "${BUILDLOG[$b]}" ]; then
for l in ${BUILDLOG[$b]}; do
SUBJOBNAME=`echo $l | sed "s|.*/${JOBNAME}_\(.*\)\..*|\1|"`
[ "${SUBJOBNAME:0:1}" = "_" ] && SUBJOBNAME=$l
[ "$SUBJOBNAME" = "$l" ] && SUBJOBNAME=`echo $l | sed "s|.*/\(.*\)\..*|\1|"`
SUBJOBNAME=${SUBJOBNAME/__*}
OPERATIONNAME=`echo $l | sed "s|\(.*\)/.*/.*|\1|"`
OPERATIONSTATUS=`echo $l | sed "s|.*/\(.*\)/.*|\1|"`
if [ $rowcnt -ge 4 ]; then
@ -273,15 +274,15 @@ _EOF
rowcnt=0
fi
if [ "$OPERATIONNAME" = "send" -a "$OPERATIONSTATUS" = "ok" ]; then
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\">$OPERATIONNAME/$OPERATIONSTATUS</a>"
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\">$OPERATIONNAME:$OPERATIONSTATUS</a>"
elif [ "$OPERATIONNAME" = "install" -a "$OPERATIONSTATUS" = "ok" ]; then
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\">$OPERATIONNAME/$OPERATIONSTATUS</a>"
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\">$OPERATIONNAME:$OPERATIONSTATUS</a>"
elif [ "$OPERATIONSTATUS" = "ok" ]; then
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=black>$OPERATIONNAME/$OPERATIONSTATUS</font></a>"
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=black>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
else
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=red>$OPERATIONNAME/$OPERATIONSTATUS</font></a>"
echo -n "<a href=\"?SHOWLOG=$l&NUM=$i$HOST_ADD\"><font color=red>$OPERATIONNAME:$OPERATIONSTATUS</font></a>"
fi
[ "$SUBJOBNAME" != "$JOBNAME" ] && echo -en "($SUBJOBNAME)"
[ "$SUBJOBNAME" != "$JOBNAME" ] && echo -en "(<a href=\"/distribution/webbuild.php?ENVIRONMENT=$i&PACKAGE=$SUBJOBNAME\" target=\"webbuild\">$SUBJOBNAME</a>)"
echo -n " "
rowcnt=`expr $rowcnt + 1`
done