webbuild: move most rpm buttons below the editor plus some other layout adjustements

This commit is contained in:
Silvan Calarco 2014-11-22 19:51:49 +01:00
parent f492d02d7d
commit f5a01c61a6
2 changed files with 91 additions and 90 deletions

View File

@ -1241,13 +1241,13 @@ fi
if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<operationpanel><![CDATA["
showEnvironmentPanel
echo -n "<hr>"
[ "$PACKAGE" ] && {
echo -n "<hr><div style=\"background-color:#E0F2D0\">"
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 "${SPECVAR_Version[0]}-${SPECVAR_Release[0]}</b></div>"
}
echo -n "Target arch:<select id=rpmbuildarch>"
echo -n "<hr>Arch:<select id=rpmbuildarch>"
for f in i586 arm x86_64 ppc; do
SELECTED=
if [ "$f" = "$RPMBUILDARCH" ]; then
@ -1258,8 +1258,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
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>"
echo -n "&nbsp;<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"rpmforce\" value=\"force\">force&nbsp;</label>"
echo -n "&nbsp;<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>"
@ -1349,6 +1349,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$PACKAGEENCODED\" $SELECTED>$PACKAGE (defaults)</option>"
fi
echo -n "</select>"
if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "$PACKAGE" ]; then
echo -n "<br><font color=red>You should use autodist for this package!</font>"
fi
if [ "$AUTODISTJOB" ]; then
echo -n "<br>Job packages:"
echo -n "<label><input type=checkbox name=autodistpkgsselectallcheckbox value=\"\" onclick=checkAllBoxes('autodistpkgscheckbox',this.checked);>select/unselect all</label>"
@ -1458,88 +1461,26 @@ if [ "$MAINTAINERMODE" != "true" ]; then
fi
fi
if [ "$PACKAGE" ]; then
echo -n "<hr><div style=\"background-color:#E0F2D0\"><b>RPM packaging commands:</b><br>"
# check for updates
echo -n "<input type=button value=\"check for updates\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecupdatescheck&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# unpack
echo -n "<input type=button value=\"prepare\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmprepare&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build
echo -n "<input type=button value=\"build\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmbuild&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>"
# unpackaged files
echo -n "<input type=button value=\"unpackaged files\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospeclistcheck&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build requirements
echo -n "<input type=button value=\"build requirements\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecbuildreq\");>"
echo -n "<hr><div style=\"background-color:#E0F2D0\">"
## check for updates
#echo -n "<input type=button value=\"check for updates\" onclick="
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecupdatescheck&"
#echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
#echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
## recreate SRPM
#echo -n "<input type=button value=\"recreate SRPM\" onclick="
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=srpmbuild&"
#echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
#echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked);>"
# rpm checks
echo -n "<input type=button id=rpmchecks value=\"checks\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmchecks\");>"
echo -n "<input type=button id=rpmsimulateinstallbutton value=\"simulate install\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmsimulateinstall\");>"
# rpm install
[ ! "$USER_CANINSTALL" ] && DISABLED="disabled=disabled"
echo -n "<input type=button id=rpminstallbutton value=\"install\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpminstall&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked"
echo -n ",\"`cgi_encodevar "Install <b>$PACKAGE</b> in current environment?"`\""
echo -n "); class=redbutton $DISABLED>"
# rpm send
if [ "$SPECVAR_CHECK_NOAUTOBUILDREQ" ]; then
HREFADD="disabled=disabled title=\"WARNING: fix specfile build requirements before you can send the package\""
else
HREFADD=
fi
echo -n "<input type=button id=sendpackagebutton value=\"send\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendpackage&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
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=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
HREFADD="disabled=disabled title=\"WARNING: fix specfile build requirements before you can send the package\""
else
HREFADD=
fi
echo -n "<input type=button id=sendsourcebutton value=\"send SRPM\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendsource&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')"
echo -n ",\"`cgi_encodevar "Send <b>$PACKAGE</b> source package only to <b>"`\"+getSelectedValueById('sendrepository')+"
echo -n "\"`cgi_encodevar "</b>?<br><br>WARNING: use this to refresh the SRPM of a package which already exists with same release in repository"`\""
echo -n "); class=redbutton $HREFADD>"
# recreate SRPM before sending checkbox
echo -n "<label style=\"color:red;padding:0;\"><input type=checkbox id=\"sendrecreatesrpm\" value=\"force\">recreate SRPM</label>"
# add patches
echo -n "<hr><b>Add patches:</b>"
echo -n "<b>Add patches:</b>"
echo -n "<input type=button id=addpatchbutton value=\"submit\" onclick=ajax_getvalues(\""
echo -n "REQUEST=addpatch&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "ADDPATCHURL=\"+encodeURIComponent(getElementById('addpatchurl').value)+\"&"
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=\"\" style=\"size:100%\">"
echo -n "URL:<input type=text id=addpatchurl value=\"\" style=\"width:80%\">"
echo -n "<br><div style=\"white-space:nowrap;font-size:9px;width:100%;overflow:hidden\"><span style=\"float:left;margin-top:6px;\">$PACKAGE-${SPECVAR_Version}-</span>"
echo -n "<span style=\"display:block;float:right;margin-top:6px;\">.patch</span>"
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\"><input type=text id=addpatchname value=\"\" style=\"width:100%\"></span></div>"
@ -1552,11 +1493,12 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "UPLOADFILENAME=\"+encodeURIComponent(getElementById('fileToUpload').value));>Upload</button>"
echo -n "</form>"
echo -n "</div><hr>"
echo -n "</div>"
# info from package sources
echo -n "<hr><div style=\"background-color:#A7DEDE\">"
echo -n "<b>Info from package in the works:</b><br>"
# show sources
echo -n "<select id=sourcefile onchange="
echo -n "<select id=sourcefile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showsourcefile&"
echo -n "SOURCEFILE=\"+getSelectedValueById('sourcefile'));>"
echo -n "<br><option value=\"\">-- select a source to display --</option>"
@ -1566,7 +1508,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
done
echo -n "</select>"
# show patches
echo -n "<select id=patchfile onchange="
echo -n "<select id=patchfile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showpatchfile&"
echo -n "PATCHFILE=\"+getSelectedValueById('patchfile'));>"
echo -n "<option value=\"\">-- select a patch to display --</option>"
@ -1599,6 +1541,15 @@ if [ "$MAINTAINERMODE" != "true" ]; then
# show package changelog
echo -n "<input type=button value=\"changelog(s)\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showchangelogs\");>"
# add a note
echo -n "<label>"
echo -n "<input type=button id=addpkgnote value=\"add a note:\" onclick="
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));></label></span>"
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\">"
echo -n "<input type=text id=pkgnote value=\"\" style=\"width:100%\">"
echo -n "</span>"
# generic info
echo -n "<hr><b>Generic info:</b><br>"
@ -1609,7 +1560,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
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 "<select id=autospectemplate style=\"width:98%\" 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>"
@ -1619,7 +1570,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
done
echo -n "</select>"
# macros
echo -n "<select id=macrosfile onchange="
echo -n "<select id=macrosfile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showmacrosfile&"
echo -n "MACROSFILE=\"+getSelectedValueById('macrosfile'));>"
echo -n "<option value=\"\">-- display a RPM macros file --</option>"
@ -1629,6 +1580,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$macrosfile\">$macrosfile</option>"
done
echo -n "</select></div>"
echo -n "</div>"
fi
echo -n "]]></operationpanel>"
fi

View File

@ -186,20 +186,69 @@ function print_editorcontrols() {
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=deletespec\",\"`cgi_encodevar "Really delete <b>$PACKAGE.spec</b>?"`\")>"
# specfile rename
echo -n "<input type=button id=updatespecbutton value=\"rename to:\" onclick="
echo -n "<input type=button id=updatespecbutton value=\"rename:\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&RENAMESPECFROM=$PACKAGE&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "REQUEST=renamespec&PACKAGE=\"+encodeURIComponent(getElementById('specnewname').value));>"
echo -n "<input type=text id=specnewname value=\"\" size=12>.spec"
# add a note
echo -n "<label>"
echo -n "<input type=button id=addpkgnote value=\"add a note:\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "<input type=text id=specnewname value=\"\" size=6>"
# unpack
echo -n "<input type=button value=\"prepare\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmprepare&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build
echo -n "<input type=button value=\"build\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmbuild&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>"
# unpackaged files
echo -n "<input type=button value=\"unpackaged list\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospeclistcheck&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build requirements
echo -n "<input type=button value=\"build reqs\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecbuildreq\");>"
# rpm install
[ ! "$USER_CANINSTALL" ] && DISABLED="disabled=disabled"
echo -n "<input type=button id=rpminstallbutton value=\"install\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpminstall&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked"
echo -n ",\"`cgi_encodevar "Install <b>$PACKAGE</b> in current environment?"`\""
echo -n "); class=redbutton $DISABLED>"
# rpm send
if [ "$SPECVAR_CHECK_NOAUTOBUILDREQ" ]; then
HREFADD="disabled=disabled title=\"WARNING: fix specfile build requirements before you can send the package\""
else
HREFADD=
fi
echo -n "<input type=button id=sendpackagebutton value=\"send\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendpackage&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "REQUEST=addpkgnote&PKGNOTE=\"+encodeURIComponent(getElementById('pkgnote').value));></label></span>"
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\">"
echo -n "<input type=text id=pkgnote value=\"\" style=\"width:100%\">"
echo -n "</span></div>"
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
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=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
HREFADD="disabled=disabled title=\"WARNING: fix specfile build requirements before you can send the package\""
else
HREFADD=
fi
echo -n "<input type=button id=sendsourcebutton value=\"send SRPM\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendsource&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')"
echo -n ",\"`cgi_encodevar "Send <b>$PACKAGE</b> source package only to <b>"`\"+getSelectedValueById('sendrepository')+"
echo -n "\"`cgi_encodevar "</b>?<br><br>WARNING: use this to refresh the SRPM of a package which already exists with same release in repository"`\""
echo -n "); class=redbutton $HREFADD>"
# recreate SRPM before sending checkbox
echo -n "<label style=\"color:red;padding:0;\"><input type=checkbox id=\"sendrecreatesrpm\" value=\"force\">recreate SRPM</label>"
# specfile update
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">"
echo -n "<input type=button id=updatespecbutton value=\"update\" onclick="