webbuild: update to current production version providing some fixes and new features

This commit is contained in:
Silvan Calarco 2013-01-19 16:24:26 +01:00
parent a0314b874b
commit 625c2b3ed2
5 changed files with 128 additions and 43 deletions

View File

@ -28,8 +28,15 @@ function socialbox_refresh_times() {
}
}
var socialbox_interval = null;
var socialbox_reloadtime = 15000;
function ajax_getvalues_refresh(request,user,user_email,secret) {
var fromid = 0;
//alert("refresh");
if (socialbox_interval != null) {
clearInterval(socialbox_interval);
}
if (document.getElementsByName("social").length > 0) {
if (document.getElementsByName("social")[0].attributes[0].name == "sid") {
fromid = parseInt(document.getElementsByName("social")[0].attributes[0].value) + 1;
@ -68,8 +75,11 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
$(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); });
// lastupdate = (+new Date());
socialbox_refresh_times();
//alert("refreshed_times");
}
xmlhttp1.open("POST", url, true);
xmlhttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp1.send(request);
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\")",socialbox_reloadtime);
}

View File

@ -30,3 +30,17 @@ function checkEnter(event) {
}
return false;
}
function replaceHTML(el, html) {
var oldEl = typeof el === "string" ? document.getElementById(el) : el;
/*@cc_on // Pure innerHTML is slightly faster in IE
oldEl.innerHTML = html;
return oldEl;
@*/
var newEl = oldEl.cloneNode(false);
newEl.innerHTML = html;
oldEl.parentNode.replaceChild(newEl, oldEl);
/* Since we just removed the old element from the DOM, return a reference
to the new element, which can be used to restore variable references. */
return newEl;
};

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# webbuild cgi script
# Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2012-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/sysconfig/autoport
. /usr/share/autodist/webbuild-functions
@ -141,6 +141,13 @@ fi
if [ "$USER" -a "$USER_ENABLED" ]; then
# set user state changes
if [ "$AUTODISTCURRENT" != "" ]; then
if [ "$AUTODISTCURRENT" = "true" ]; then
set_user_state_var STATE_AUTODISTCURRENT 1
else
set_user_state_var STATE_AUTODISTCURRENT 0
fi
fi
if [ "$ADVANCEDCONTROLSSWITCH" != "" ]; then
if [ "$ADVANCEDCONTROLSSWITCH" = "true" ]; then
set_user_state_var STATE_ADVANCEDCONTROLS 1
@ -314,6 +321,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
# if [ -e /proc/$1 -o $5 -lt 256 ]; then
numprocess=`expr $numprocess + 1`
cmdline=`echo $line | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"`
cmdline=`echo $cmdline | sed "s| --colors web||"`
PACKAGE_ENCODED=`cgi_encodevar $4`
[ $numprocess -eq 1 ] && {
echo -n "<div align=left class=processes>"
@ -404,12 +412,12 @@ if [ "$REQUEST" = "environmentsearch" ]; then
echo -n "$WHAT_PROVIDES<br>"
if [ "${WHAT_PROVIDES:0:10}" != "no package" ]; then
for f in $WHAT_PROVIDES; do
echo -n "<font style=\"background-color:gray\">$f installed package info:</font><br>"
echo -n "<br><font style=\"background-color:gray\">$f installed package info:</font><br>"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "rpm -qi $f"
if [ $? -eq 0 ]; then
echo -n "<font style=\"color:gold\">$f provides:</font><br>"
echo -n "<br><font style=\"color:gold\">$f provides:</font><br>"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "rpm -q $f --provides"
echo -n "<font style=\"color:gold\">$f requirements:</font><br>"
echo -n "<br><font style=\"color:gold\">$f requirements:</font><br>"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "rpm -q $f --requires"
fi
done
@ -470,14 +478,14 @@ echo -n "<input type=button id=newsessionbutton value=\"New session\" onclick="
echo -n "window.open(document.URL);>"
# expert mode checkbox
[ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED=
echo -n " <span style=\"white-space:nowrap\">Expert:<input type=checkbox id=\"advancedcontrols\" value=\"force\" "
echo -n " <span style=\"white-space:nowrap\">Autodist:<input type=checkbox id=\"advancedcontrols\" "
echo -n "onclick=ajax_getvalues(\""
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
echo -n "ADVANCEDCONTROLSSWITCH=\"+getElementById('advancedcontrols').checked); $CHECKED>"
# privacy mode checkbox
[ "$STATE_PRIVACYMODE" ] && CHECKED="checked=checked" || CHECKED=
echo -n " <span style=\"white-space:nowrap\">Privacy:<input type=checkbox id=\"privacymode\" value=\"force\" "
echo -n " <span style=\"white-space:nowrap\">Privacy:<input type=checkbox id=\"privacymode\" "
echo -n "onclick=ajax_getvalues(\""
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "PRIVACYMODESWITCH=\"+getElementById('privacymode').checked); $CHECKED>"
@ -532,7 +540,7 @@ echo -n "]]></environments>"
if [ "$MAINTAINERMODE" = "true" ]; then
echo -n "<specedit> </specedit>"
elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "prepare" ]; then
elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" ]; then
# SPECFILES select
echo -n "<specedit><![CDATA["
echo -n " Edit:<select id=specfile "
@ -609,18 +617,18 @@ else
# autobuild edit previous
echo -n "<input type=button name=autobuildeditprev value=\" < \" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById(\"autobuildedit\",-1).substring(0,getSelectedValueById(\"autobuildedit\",-1).indexOf(';')))+\"&"
echo -n "LOGTYPE=\"+getSelectedValueById(\"autobuildedit\",-1).substring(getSelectedValueById(\"autobuildedit\",-1).indexOf(';')+1)+\"&REQUEST=autobuildedit\");>"
echo -n "LOGTYPE=\"+getSelectedValueById(\"autobuildedit\",-1).substring(getSelectedValueById(\"autobuildedit\",-1).indexOf(';')+1)+\"&LOGSTATUSOK=&"
echo -n "REQUEST=autobuildedit\");>"
# autobuild edit select
echo -n "<select id=autobuildedit "
echo -n "onchange=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "PACKAGE=\"+encodeURIComponent(this.value.substring(0,this.value.indexOf(';')))+\"&"
echo -n "LOGTYPE=\"+this.value.substring(this.value.indexOf(';')+1)+\"&REQUEST=autobuildedit\");>"
echo -n "LOGTYPE=\"+this.value.substring(this.value.indexOf(';')+1)+\"&LOGSTATUSOK=&"
echo -n "REQUEST=autobuildedit\");>"
echo -n "<option value=\"\">-- Select a failed build to review --</option>"
SELECTED=
[ "$AUTODISTCURRENT" = "true" ] && AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-current || AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-last
[ "$STATE_AUTODISTCURRENT" = "1" ] && AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-current || AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-last
while read line; do
set -- $line
if [ "$3" = "failed" -a "$2" != "autoupdate" ]; then
@ -644,11 +652,11 @@ else
# autobuild edit next
echo -n "<input type=button name=autobuildeditnext value=\" > \" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById(\"autobuildedit\",1).substring(0,getSelectedValueById(\"autobuildedit\",1).indexOf(';')))+\"&"
echo -n "LOGTYPE=\"+getSelectedValueById(\"autobuildedit\",1).substring(getSelectedValueById(\"autobuildedit\",1).indexOf(';')+1)+\"&REQUEST=autobuildedit\");>"
echo -n "LOGTYPE=\"+getSelectedValueById(\"autobuildedit\",1).substring(getSelectedValueById(\"autobuildedit\",1).indexOf(';')+1)+\"&LOGSTATUSOK=&"
echo -n "REQUEST=autobuildedit\");>"
# autodist current checkbox (in progress)
[ "$AUTODISTCURRENT" = "true" ] && SELECTED="checked" || SELECTED=
[ "$STATE_AUTODISTCURRENT" = "1" ] && SELECTED="checked" || SELECTED=
echo -n "<label><input type=checkbox id=\"autodistcurrentcheckbox\" value=\"autodistcurrent\" $SELECTED onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
@ -708,12 +716,18 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
echo -n "<operations><![CDATA["
echo -n "<input type=button name=prepare value=\"Unpack and edit\" id=preparebutton onclick="
echo -n "ajax_getvalues(\"REQUEST=prepare&REPOSITORY=\"+getSelectedValueById('repository')+\""
echo -n "&ENVIRONMENT=$ENVIRONMENT&MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
echo -n "&ENVIRONMENT=$ENVIRONMENT&"
if [ "$USER_CANMAINTAIN" ]; then
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
fi
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>"
if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then
echo -n "<input type=button name=port value=\"Port\" id=portbutton onclick="
echo -n "ajax_getvalues(\"REQUEST=autoport&REPOSITORY=\"+getSelectedValueById('repository')+\""
echo -n "&ENVIRONMENT=$ENVIRONMENT&MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
echo -n "&ENVIRONMENT=$ENVIRONMENT&"
if [ "$USER_CANMAINTAIN" ]; then
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
fi
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('specfile'))+\"&"
echo -n "AUTOPORTPACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>"
fi
@ -772,7 +786,7 @@ fi
if [ "$REQUEST" = "edit" -o "$REQUEST" = "prepare" ]; then
if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b>\" STIME=`date +%s`"
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`"
fi
fi
@ -786,10 +800,10 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
case $REQUEST in
"prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
"updatespec") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-update"
[ "$DEBUG" = "true" ] && RPMFORCEADD="$RPMFORCEADD --debug"
if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
echo "ERROR: new version and changelog can't be specified together"
elif [ "$REBUILDSPECCHANGELOG" ]; then
echo "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild --changelog \"$REBUILDSPECCHANGELOG\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild --changelog \"$REBUILDSPECCHANGELOG\""
elif [ "$UPDATESPECVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a3,4 $RPMFORCEADD $UPDATESPECVERSION"
@ -839,6 +853,10 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
RET=$?
;;
"autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
[ "$DEBUG" = "true" ] && AUTODISTADD="$AUTODISTADD --debug" || AUTODISTADD=
if [ "$AUTODISTUPDATECHANGELOG" ]; then
AUTODISTADD="$AUTODISTADD --rebuild -- --changelog \"${AUTODISTUPDATECHANGELOG}\""
fi
autodistjobs=
if [ "$AUTODISTPKGS" ]; then
for p in $AUTODISTPKGS; do
@ -950,17 +968,24 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<operationpanel><![CDATA["
showEnvironmentPanel
echo -n "<hr>"
[ "$PACKAGE" ] && echo -n "Package: <b>$PACKAGE</b><br>Version: <b>${SPECVAR_Version[0]}-${SPECVAR_Release[0]}</b><br>"
[ "$PACKAGE" ] && {
echo -n "Package: <b>$PACKAGE</b><br>Version: <b>"
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" || echo -n "0:"
echo -n "${SPECVAR_Version[0]}-${SPECVAR_Release[0]}</b><br>"
}
echo -n "Target arch:<select id=rpmbuildarch>"
for f in i586 arm x86_64 ppc; do
SELECTED=
if [ ! "$RPMBUILDARCH" -a "$f" = "${AUTOPORT_ARCH[$ENVIRONMENT]}" ]; then
if [ "$f" = "$RPMBUILDARCH" ]; then
SELECTED="selected=\"selected\"";
elif [ ! "$RPMBUILDARCH" -a "$f" = "${AUTOPORT_ARCH[$ENVIRONMENT]}" ]; then
SELECTED="selected=\"selected\"";
fi
echo -n "<option value=\"$f\" $SELECTED>$f</option>"
done
echo -n "</select>"
echo -n "<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"rpmforce\" value=\"force\">force&nbsp;</label>"
echo -n "<label style=\"padding:1px;\"><input type=checkbox id=\"debug\" value=\"debug\">debug&nbsp;</label>"
# destination repository select
echo -n "<br>Send to:"
echo -n "<select id=sendrepository>"
@ -1029,7 +1054,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
if [ "$AUTODISTJOB" -a "$AUTODISTJOB" = "$f" ]; then
SELECTED="selected=\"selected\""
AUTODISTJOBSELECTED=1
elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOBSELECTED" ]; then
elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOB" ]; then
# elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOBSELECTED" -a "$REQUEST" != "autodistjobchange" ]; then
SELECTED="selected=\"selected\""
AUTODISTJOB=$f
AUTODISTJOBSELECTED=1
@ -1044,7 +1070,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then
fi
echo -n "</select>"
if [ "$AUTODISTJOB" ]; then
echo -n "<br>Job packages:<div class=multiselect style=\"height:60px;\">"
echo -n "<br>Job packages:"
echo -n "<label><input type=checkbox name=autodistpkgsselectallcheckbox value=\"\" onclick=checkAllBoxes('autodistpkgscheckbox',this.checked);>select/unselect all</label>"
echo -n "<div class=multiselect style=\"height:60px;\">"
for p in `$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist --list-pkgs $AUTODISTJOB"`; do
if [ "$AUTODISTPKGS" ]; then
for i in $AUTODISTPKGS; do
@ -1068,9 +1096,11 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<input type=button value=\"update\" onclick="
echo -n "p=getCheckedValuesByName('autodistpkgscheckbox');ajax_getvalues(\""
echo -n "AUTODISTFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "DEBUG=\"+getElementById('debug').checked+\"&"
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&"
echo -n "AUTODISTUPDATECHANGELOG=\"+encodeURIComponent(getElementById('autodistupdatechangelog').value)+\"&"
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistupdate\");>"
# autodist build
echo -n "<input type=button value=\"build\" onclick="
@ -1105,6 +1135,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistsend\""
echo -n ",\"`cgi_encodevar "Send selected packages for <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> job to <b>"`\"+"
echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "</b>?"`\"); class=redbutton $DISABLED>"
# autodist update changelog
echo -n "Rebuild changelog:"
echo -n "<input type=text id=autodistupdatechangelog style=\"width:95%\">"
# autodist schedule
echo -n "<br><input type=button value=\"schedule job\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
@ -1114,17 +1147,14 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "(version:<input type=text id=scheduleversion value=\"\" size=\"6\">)"
# autodist show schedule
echo -n "<input type=button value=\"show schedule\" onclick=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "REQUEST=showscheduled\");>"
# autodist unschedule
echo -n "<input type=button value=\"unschedule\" onclick=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "REQUEST=unschedule\"); class=redbutton>"
# autodist skip
echo -n "<input type=button value=\"skip\" onclick=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTCURRENT=\"+getElementById('autodistcurrentcheckbox').checked+\"&"
echo -n "REQUEST=skip\""
echo -n ",\"`cgi_encodevar "Skip <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> from being checked for automatic updates for a period?"`\""
echo -n "); class=redbutton><br>"
@ -1240,7 +1270,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "ADDPATCHNAME=\"+encodeURIComponent(getElementById('addpatchname').value));>"
echo -n "&nbsp;<a href=\"http://pastebin.com\" target=_new>pastebin</a><br>"
echo -n "URL:<input type=text id=addpatchurl value=\"\" size=\"28\">"
echo -n "<br>As: $PACKAGE-<input type=text id=addpatchname value=\"\" size=\"13\">.patch"
echo -n "<br>$PACKAGE-${SPECVAR_Version}-<input type=text id=addpatchname value=\"\" size=\"10\">.patch"
echo -n "</div><hr>"
# info from package sources
echo -n "<b>Info from package in the works:</b><br>"
@ -1296,6 +1326,16 @@ if [ "$MAINTAINERMODE" != "true" ]; then
# approved licenses
echo -n "<input type=button value=\"approved licenses\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=approvedlicenses\");>"
# templates
echo -n "<select id=autospectemplate onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showautospectemplate&"
echo -n "AUTOSPECTEMPLATE=\"+getSelectedValueById('autospectemplate'));>"
echo -n "<option value=\"\">-- display a .spec template --</option>"
for f in $WORKINGROOT/usr/share/autospec/templates/*; do
autospectemplatename=`basename $f`
echo -n "<option value=\"$autospectemplatename\">$autospectemplatename</option>"
done
echo -n "</select></div>"
# macros
echo -n "<select id=macrosfile onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showmacrosfile&"
@ -1325,7 +1365,9 @@ echo -n "</textarea>"
echo -n "]]></chatpanel>"
if [ "$REQUEST" != "" ]; then
echo -n "<output><![CDATA[<hr><b>Console output ($REQUEST for $PACKAGE):</b>"
echo -n "<output><![CDATA[<hr><b>Console output ($REQUEST"
[ "$PACKAGE" ] && echo -n " for $PACKAGE"
echo -n "):</b>"
echo -n "<div align=left class=output "
if [ "$REQUEST" = "rpmbuild" -o "$REQUEST" = "autoportnp" -o "$REQUEST" = "rpmprepare" \
-o "$REQUEST" = "sendpackage" -o "$REQUEST" = "sendsource" -o "$REQUEST" = "autospeclistcheck" \
@ -1516,13 +1558,13 @@ case $REQUEST in
fi
;;
"addpatch") if [ "$ADDPATCHURL" -a "$ADDPATCHNAME" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "curl -skL \"$ADDPATCHURL\" -o ../SOURCES/$PACKAGE-$ADDPATCHNAME.patch"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "curl -sSkL '$ADDPATCHURL' -o ../SOURCES/$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch"
RET=$?
[ $RET -eq 0 ] && {
echo -n "Patch added with name <b>$PACKAGE-$ADDPATCHNAME.patch</b>."
echo -n "Patch added with name <b>$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch</b>."
echo -n "<br><br><font color=gold>HINT: add the following lines to the .spec file in the appropriate sections (fix indexes if needed):</font><br>"
NEWPATCHNUM=`expr ${#SPECVAR_Patch[*]} + 1`
echo -ne "<br><pre>Patch$NEWPATCHNUM: $PACKAGE-$ADDPATCHNAME.patch\n\n%patch$NEWPATCHNUM -p1</pre>"
echo -ne "<br><pre>Patch$NEWPATCHNUM: $PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch\n\n%patch$NEWPATCHNUM -p1</pre>"
RET=-1
}
else
@ -1681,6 +1723,9 @@ case $REQUEST in
"configurelog") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && cat config.log"
RET=$?
[ $RET -eq 0 ] && RET=-1 ;;
"showautospectemplate") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cat /usr/share/autospec/templates/$AUTOSPECTEMPLATE"
RET=$?
[ $RET -eq 0 ] && RET=-1 ;;
"showmacrosfile") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cat /etc/rpm/macros.$MACROSFILE"
RET=$?
[ $RET -eq 0 ] && RET=-1 ;;
@ -1860,10 +1905,14 @@ if [ "$MAINTAINERMODE" = "true" ]; then
[ "$REPOSITORY" ] && echo -n "$REPOSITORY " || echo -n "no repository "
echo -n "(Maintainer mode)"
else
[ "$PACKAGE" ] && echo -n "$PACKAGE $SPECVAR_Version-$SPECVAR_Release " || echo -n "no package "
echo -n "("
print_environment_descr $ENVIRONMENT
echo -n ")"
[ "$PACKAGE" ] && {
echo -n "$PACKAGE "
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:"
echo -n "$SPECVAR_Version-$SPECVAR_Release " || echo -n "no package "
echo -n "("
print_environment_descr $ENVIRONMENT
echo -n ")"
}
fi
echo -n " :: openmamba webbuild</title>"

View File

@ -53,7 +53,7 @@ function showlog() {
tail -n +0 -f $f --pid $PROCESSPID | sed "s|<|\&lt;|g"
echo -n "<!-- ENDSCROLL -->"
else
if [ $LOGFILESIZE -lt 131072 ]; then
if [ $LOGFILESIZE -lt 524288 ]; then
if [ -r $f ]; then
cat $f | parse_build_output $PACKAGE
else
@ -61,13 +61,13 @@ function showlog() {
fi
else
if [ -r $f ]; then
head -c 65535 $f | parse_build_output $PACKAGE
head -c 262144 $f | parse_build_output $PACKAGE
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) -------&gt;</font>"
tail -c 65535 $f | parse_build_output $PACKAGE
tail -c 262144 $f | parse_build_output $PACKAGE
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 65535 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 262144 $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 65535 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "tail -c 262144 $f" | parse_build_output $PACKAGE
fi
fi
fi
@ -99,8 +99,15 @@ function showEnvironmentPanel() {
#echo "<br>Base repository: <b>${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}</b>"
# toolchain
echo -n "<br>"
local toolchain_output=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "LANGUAGE=C 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"
# smart upgrade
echo -n "<input type=button id=smartupgrade value=\"system upgrade\" onclick="
echo -n "<br><input type=button id=smartupgrade value=\"system upgrade\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=smartupgrade\""
echo -n ",\"`cgi_encodevar "Upgrade current environment to latest updates now?"`\"); class=redbutton>"
@ -111,7 +118,7 @@ function showEnvironmentPanel() {
#echo -n "REQUEST=runldconfig\");>"
# environment search
echo -n "<br>Installed:<input type=text size=23 style=\"align:center;padding:0;margin:2px;\" id=environmentsearch value=\"Search package or provide...\" "
echo -n "<br>Provides:<input type=text size=23 style=\"align:center;padding:0;margin:2px;\" id=environmentsearch value=\"Search package or provide...\" "
echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
echo -n "onkeypress=if(checkEnter(event))ajax_getvalues(\""
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
@ -147,12 +154,13 @@ function print_editorcontrols() {
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "REQUEST=addpkgnote&PKGNOTE=\"+encodeURIComponent(getElementById('pkgnote').value));>"
echo -n "<input type=text id=pkgnote value=\"\" size=\"55\">"
echo -n "<input type=text id=pkgnote value=\"\" size=\"50\">"
# specfile update
echo -n "<br><input type=button id=updatespecbutton value=\"update\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=updatespec&UPDATESPECVERSION=\"+getElementById('updatespecversion').value+\"&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "DEBUG=\"+getElementById('debug').checked+\"&"
echo -n "REBUILDSPECCHANGELOG=\"+encodeURIComponent(getElementById('rebuildspecchangelog').value)+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
echo -n " (specify new version:<input type=text id=updatespecversion value=\"\" size=\"12\">"

View File

@ -114,9 +114,11 @@ cmdtmpfile=`mktemp --suffix=.webbuildcmd`
[ "$PACKAGE" ] || PACKAGE=nopackage
if [ "$MODE" = "background" ]; then
if [ "$WORKINGHOME" ]; then
[ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\""
$SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | tr -d '\f' > $cmdtmpfile &
#sed "s|<|\&lt;|g" |
else
[ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"$COMMAND\""
$SUCMDPREFIX "$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | sed "s|<|\&lt;|g" | tr -d '\f' > $cmdtmpfile &
fi
echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
@ -128,9 +130,11 @@ else
echo "$$ $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
rettmpfile=`$SUCMDPREFIX "mktemp --suffix=.webbuildret"`
if [ "$WORKINGHOME" ]; then
[ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\""
$SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \$? > $rettmpfile" 2>&1 | tr -d '\f' | tee $cmdtmpfile
# sed "s|<|\&lt;|g" |
else
[ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"$COMMAND\""
$SUCMDPREFIX "$COMMAND;echo \$? > $rettmpfile" 2>&1 | tr -d '\f' | tee $cmdtmpfile
# sed "s|<|\&lt;|g" |
fi