webbuild: some small bugfixes

This commit is contained in:
Silvan Calarco 2013-04-22 12:33:50 +02:00
parent 2674eed1f2
commit 8576dc1d8c
4 changed files with 42 additions and 24 deletions

View File

@ -70,8 +70,9 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
"<span name=social sid=\""+ id + "\">" + nodes[i].childNodes[0].nodeValue + "</span>" +
document.getElementById("socialbox").innerHTML;
}
if (xmldoc.getElementsByTagName("processes")[0] != undefined)
if (xmldoc.getElementsByTagName("processes")[0] != undefined) {
document.getElementById("processes").innerHTML = xmldoc.getElementsByTagName("processes")[0].childNodes[0].nodeValue;
}
$(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); });
// lastupdate = (+new Date());
socialbox_refresh_times();

View File

@ -222,15 +222,15 @@ if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then
else
USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"`
fi
echo -n "<add id=\"$SID\"><![CDATA[<div style=\"vertical-align:middle;position:relative;float:left;height:24px;width:24px;\">"
echo -n "<add id=\"$SID\"><![CDATA[<div style=\"margin:0;padding:0;\"><div style=\"vertical-align:middle;position:relative;float:left;height:24px;width:24px;margin-right:2px;\">"
echo -n "<img src=\"http://www.gravatar.com/avatar/$USER_GRAVATAR?s=24&d=http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=24\" /></div>"
if [ "$SPRIVACY" -a ! "$USER" ]; then
SUSER="a developer"
elif [ "$USER" = "$SUSER" ]; then
SUSER="you"
fi
echo -n "<div style=\"position:relative;float:right;height:auto;width:164px;\"><b>$SUSER</b> $STEXT <i><span name=socialtime time=$STIME></span></i></div><br>"
echo -n "<div style=\"clear:both;\"><hr></div>]]></add>"
echo -n "<div style=\"position:relative;margin-left:24px;height:auto;padding:0;\"><b>$SUSER</b> $STEXT <i><span name=socialtime time=$STIME></span></i></div>"
echo -n "</div><div style=\"clear:both;\"><hr></div>]]></add>"
count=`expr $count + 1`
done
echo -n "</socialbox>"
@ -393,7 +393,7 @@ if [ "$REQUEST" = "repsearch" ]; then
echo -n "<output><![CDATA["
echo -n "<hr><b>Repository search results for \"$REPSEARCHTEXT\":</b><div align=left class=output id=outputtop>"
echo -n "<pre><!-- SCROLL -->"
$SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i $REPSEARCHTEXT" | \
$SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \
parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
# sed "s|\(.*(source).*\)|<font color=white><b>\1</b></font>|;
# s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|"
@ -613,7 +613,9 @@ if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$MAINTAINERMODE" = "true" ]; then
echo -n "<operations> </operations>"
fi
else
echo -n "<repositories><![CDATA[Review failed autobuilds:"
echo -n "<repositories><![CDATA[Review failed <a href=\"$AUTOBUILDS_STATUS_URL\" target=\"autobuilds\""
echo -n " title=\"Open autobuilds status page in a new window\">autobuilds</a>:"
# autobuild edit previous
echo -n "<input type=button name=autobuildeditprev value=\" < \" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&"
@ -738,19 +740,22 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
# SPECFILE creation
if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -a "$MAINTAINERMODE" != "true" ]; then
echo -n "<speccreate><![CDATA["
echo -n " Start from URL:<input type=text id=speccreateurl value=\"\" size=\"55\">"
echo -n " Start from URL:<input type=text id=speccreateurl value=\"\" size=\"50\">"
echo -n " name:<input type=text id=speccreatename value=\"\" size=\"10\">"
echo -n " type:<select id=speccreatetype>"
for t in standard gnome kde3 kde4 library perl python standard-daemon; do
echo -n "<option value=\"$t\">$t</option>"
for t in `ls /usr/share/autospec/templates`; do
[ "$t" = "library" ] && SELECTED="selected=selected" || SELECTED=
echo -n "<option value=\"$t\" $SELECTED>$t</option>"
done
echo -n "</select>"
echo -n " version:<input type=text id=speccreateversion value=\"\" size=\"6\">"
echo -n " version:<input type=text id=speccreateversion value=\"\" size=\"5\">"
echo -n " branch:<input type=text id=speccreategitbranch value=\"\" size=\"5\">"
echo -n "<input type=button id=speccreatebutton value=\"Create .spec\" onclick=ajax_getvalues(\""
echo -n "REQUEST=speccreate&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
echo -n "PACKAGE=\"+encodeURIComponent(getElementById('speccreatename').value)+\"&"
echo -n "SPECCREATETYPE=\"+getElementById('speccreatetype').value+\"&"
echo -n "SPECCREATEVERSION=\"+getElementById('speccreateversion').value+\"&"
echo -n "SPECCREATEGITBRANCH=\"+getElementById('speccreategitbranch').value+\"&"
echo -n "SPECCREATEURL=\"+encodeURIComponent(getElementById('speccreateurl').value));>"
echo "]]></speccreate>"
elif [ "$MAINTAINERMODE" = "true" ]; then
@ -817,6 +822,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
#DECODEDURL=`cgi_decodevar $SPECCREATEURL`
[ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
[ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
[ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v --git-branch $SPECCREATEGITBRANCH"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE --changelog \"package created by $USER using the webbuild interface\""
RET=$?
[ $RET -eq 0 ] && {
@ -989,20 +995,30 @@ if [ "$MAINTAINERMODE" != "true" ]; then
# destination repository select
echo -n "<br>Send to:"
echo -n "<select id=sendrepository>"
for f in `$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/openmamba-repository list"`; do
if [ "$USER_ALLREPOSITORIES" ]; then
SEND_REPS=`$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/openmamba-repository list"`
elif [ "$USER_CANMAINTAIN_REPOSITORIES" ]; then
SEND_REPS="$USER_CANMAINTAIN_REPOSITORIES";
for u in $USER_CANMAINTAIN_REPOSITORIES devel-$USER; do
[ "$u" = "$repname" ] && echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
done
else
SEND_REPS="devel-contrib"
fi
for f in $SEND_REPS; do
repname=`basename $f`
if [ "$repname" = "devel-${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" -o \
"$repname" = "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" -o \
"$repname" = "devel-$USER" -o \
"$USER_ALLREPOSITORIES" ]; then
SELECTED=
if [ "$SENDREPOSITORY" = "$repname" ]; then
SELECTED="selected=\"selected\"";
elif [ ! "$SENDREPOSITORY" -a "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" = "$repname" ]; then
SELECTED="selected=\"selected\"";
fi
echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
# if [ "$repname" = "devel-${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" -o \
# "$repname" = "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" -o \
# "$repname" = "devel-$USER" -o \
# "$USER_ALLREPOSITORIES" ]; then
SELECTED=
if [ "$SENDREPOSITORY" = "$repname" ]; then
SELECTED="selected=\"selected\"";
elif [ ! "$SENDREPOSITORY" -a "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" = "$repname" ]; then
SELECTED="selected=\"selected\"";
fi
echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
# fi
done
echo -n "</select><br>"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<hr><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><br>"

View File

@ -34,6 +34,7 @@ function showlog() {
LOGFILES="$LOGFILES $LOGDIR/$LOGFILE1 $LOGDIR/$LOGFILE2 $LOGDIR/$LOGFILE3 $LOGDIR/$LOGFILE4"
fi
done
LOGFILES=`ls -t $LOGFILES | head -1`
fi
echo -n "<output><![CDATA[<hr><b>Console output for $PACKAGE ($LOGTYPE$LOGSTATUSAPPEND):</b>"
echo "<div align=left class=output id=$LOGOUTPUTID>"

View File

@ -94,7 +94,7 @@ if [ "$MODE" = "specinfo" ]; then
specvar="SPECVAR_${1/:*}"
specvar="${specvar/[0-9]*}"
[ "$specvar" = "$lastspecvar" ] && varidx=`expr $varidx + 1` || varidx=0
echo "$specvar[$varidx]=\"${line}\""
echo "$specvar[$varidx]=\"${line//\"/}\""
[ "$specvar" = "SPECVAR_Version" -a ! "$BUILDDIR" ] && BUILDDIR="$PACKAGE-${line}"
fi
lastspecvar=$specvar
@ -114,7 +114,7 @@ if [ "$MODE" = "specinfo" ]; then
fi
echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log
cmdtmpfile=`mktemp --suffix=.webbuildcmd`
cmdtmpfile=`mktemp --tmpdir=$WEBBUILD_STATEDIR/tmp --suffix=.webbuildcmd`
[ "$PACKAGE" ] || PACKAGE=nopackage
if [ "$MODE" = "background" ]; then