webbuild: sync to current running files with lots of fixes and small changes

This commit is contained in:
Silvan Calarco 2013-11-09 14:31:17 +01:00
parent 10b3f8eff0
commit a939e6217a
4 changed files with 89 additions and 41 deletions

View File

@ -391,7 +391,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
else else
echo "[ <a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Show mine only</a> ]" echo "[ <a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Show mine only</a> ]"
fi fi
#echo -n "<i>(please click on [x] to clean your build logs when you are done)</i>" echo -n "<i>(please click on [x] to clean your jobs when they are done)</i>"
echo -n "<br>" echo -n "<br>"
} }
[ "$STATE_JOBSSHOWALL" = "1" -o "$USER" = "$2" ] || continue [ "$STATE_JOBSSHOWALL" = "1" -o "$USER" = "$2" ] || continue
@ -451,14 +451,17 @@ fi
# repsearch request # repsearch request
if [ "$REQUEST" = "repsearch" ]; then if [ "$REQUEST" = "repsearch" ]; then
echo -n "<output><![CDATA[" echo -n "<output><![CDATA["
echo -n "<hr><b>Repository search results for \"$REPSEARCHTEXT\":</b><div align=left class=output id=outputtop>" echo -n "<hr><b>Search results for \"$REPSEARCHTEXT\":</b><div align=left class=output id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
echo -n "<pre><!-- SCROLL -->" # echo -n "<pre><!-- SCROLL -->"
$SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \ curl -s "http://test.openmamba.org/cgi-bin/distroquery?query=$REPSEARCHTEXT&search_milestone2=true&search_devel=true\
parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]} &search_i586=true&search_x86_64=true&search_arm=true&search_sources=true&query_compact=true&replyplain=true"
# $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>|; # sed "s|\(.*(source).*\)|<font color=white><b>\1</b></font>|;
# s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|" # s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|"
echo -n "<!-- ENDSCROLL --></pre>" # echo -n "<!-- ENDSCROLL --></pre>"
echo "</div>]]></output></webbuild>" echo "</div>"
echo "]]></output></webbuild>"
exit exit
fi fi
@ -491,10 +494,10 @@ fi
# rpm manager # rpm manager
if [ "$REQUEST" = "rpmmanager" ]; then if [ "$REQUEST" = "rpmmanager" ]; then
environment_descr=`print_environment_descr $i` environment_descr=`print_environment_descr $ENVIRONMENT`
echo -n "<window><![CDATA[" echo -n "<window><![CDATA["
echo -n "<div class=windowcontainer><div class=windowopaquebackground></div>" echo -n "<div class=windowcontainer><div class=windowopaquebackground></div>"
echo -n "<div class=windowbox><div style=\"overflow:auto;width:600px;height:420px\">" echo -n "<div class=windowbox style=\"top:-50px;\"><div style=\"overflow:auto;width:600px;height:420px\">"
echo -n "RPM manager for <b>$environment_descr</b> environment<br>" echo -n "RPM manager for <b>$environment_descr</b> environment<br>"
# select rpm manager resource directory to display # select rpm manager resource directory to display
@ -533,7 +536,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} " echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} "
echo -n "<a title=\"Click to download file\" href=\"#\" " echo -n "<a title=\"Click to download file\" href=\"#\" "
echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&" echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&"
echo -n "&REPOSITORY=$REPOSITORY&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>" echo -n "&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
echo -n "<img src=/images/download.png width=16 height=16></img></a>" echo -n "<img src=/images/download.png width=16 height=16></img></a>"
echo -n "</label>" echo -n "</label>"
done done
@ -546,7 +549,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} " echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} "
echo -n "<a title=\"Click to download file\" href=\"#\" " echo -n "<a title=\"Click to download file\" href=\"#\" "
echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&" echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&"
echo -n "&REPOSITORY=$REPOSITORY&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>" echo -n "&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
echo -n "<img src=/images/download.png width=16 height=16></img></a>" echo -n "<img src=/images/download.png width=16 height=16></img></a>"
echo -n "</label>" echo -n "</label>"
done done
@ -560,7 +563,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
# rpm manager install packages # rpm manager install packages
echo -n "<input type=button value=\"install\" onclick=" echo -n "<input type=button value=\"install\" onclick="
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');" echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&" echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&" echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&" echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&" echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
@ -571,7 +574,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
# rpm manager upgrade packages # rpm manager upgrade packages
echo -n "<input type=button value=\"upgrade\" onclick=" echo -n "<input type=button value=\"upgrade\" onclick="
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');" echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&" echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&" echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&" echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
echo -n "REQUEST=rpmmanagerupgrade\"" echo -n "REQUEST=rpmmanagerupgrade\""
@ -698,7 +701,8 @@ echo -n "]]></environments>"
if [ "$MAINTAINERMODE" = "true" ]; then if [ "$MAINTAINERMODE" = "true" ]; then
echo -n "<specedit> </specedit>" echo -n "<specedit> </specedit>"
elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" ]; then elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" \
-o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" -o "$REQUEST" = "edit" ]; then
# SPECFILES select # SPECFILES select
echo -n "<specedit><![CDATA[" echo -n "<specedit><![CDATA["
echo -n " Edit:<select id=specfile " echo -n " Edit:<select id=specfile "
@ -726,11 +730,13 @@ fi
if [ ! "$REPSEARCHTEXT" ]; then if [ ! "$REPSEARCHTEXT" ]; then
echo -n "<searchbox><![CDATA[" echo -n "<searchbox><![CDATA["
echo -n "<div class=searchbox>Search repositories:" echo -n "<div class=searchbox>Search repositories:"
#<input type=button id=repsearchbutton value=\"Search repositories:\" onclick=ajax_getvalues(\"" #<input type=button id=repsearchbutton value=\"Search repositories:\" onclick=ajax_getvalues(\""
# echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&" # echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
# echo -n "REQUEST=repsearch&REPSEARCHTEXT=\"+encodeURIComponent(getElementById('repsearchtext').value));>" # echo -n "REQUEST=repsearch&REPSEARCHTEXT=\"+encodeURIComponent(getElementById('repsearchtext').value));>"
if [ "$PACKAGE" ]; then if [ "$PACKAGE" ]; then
echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"${PACKAGE/*\/}-\" " echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"${PACKAGE/*\/}\" "
else else
echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"Enter a package name to search...\" " echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"Enter a package name to search...\" "
echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" " echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
@ -895,7 +901,7 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&" echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
fi fi
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>" echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>"
if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then if [ "${AUTOPORT_PORT[$ENVIRONMENT]}" ]; then
echo -n "<input type=button name=port value=\"Port\" id=portbutton onclick=" echo -n "<input type=button name=port value=\"Port\" id=portbutton onclick="
echo -n "ajax_getvalues(\"REQUEST=autoport&REPOSITORY=\"+getSelectedValueById('repository')+\"" echo -n "ajax_getvalues(\"REQUEST=autoport&REPOSITORY=\"+getSelectedValueById('repository')+\""
echo -n "&ENVIRONMENT=$ENVIRONMENT&" echo -n "&ENVIRONMENT=$ENVIRONMENT&"
@ -952,7 +958,11 @@ if [ "$SPECTEXT" ]; then
tmpfile=`mktemp --suffix=.webbuildspectmp` tmpfile=`mktemp --suffix=.webbuildspectmp`
echo -n $SPECTEXT | perl -MURI::Escape -e 'print uri_unescape(<>)' > $tmpfile echo -n $SPECTEXT | perl -MURI::Escape -e 'print uri_unescape(<>)' > $tmpfile
chmod 644 $tmpfile chmod 644 $tmpfile
if [ "REQUEST" = "renamespec" -a "$RENAMESPECFROM" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${RENAMESPECFROM/*\/}.spec" $tmpfile
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${PACKAGE/*\/}.spec" $tmpfile $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${PACKAGE/*\/}.spec" $tmpfile
fi
RET=$? RET=$?
[ $RET -eq 0 ] || { [ $RET -eq 0 ] || {
echo -n "<output><![CDATA[<div class=output>ERROR: could not save file ${PACKAGE/*\/}.spec! Please report the problem, thanks.</div>]]></output></webbuild>" echo -n "<output><![CDATA[<div class=output>ERROR: could not save file ${PACKAGE/*\/}.spec! Please report the problem, thanks.</div>]]></output></webbuild>"
@ -978,24 +988,34 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
"prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;; "prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
"updatespec") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-update" "updatespec") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-update"
[ "$DEBUG" = "true" ] && RPMFORCEADD="$RPMFORCEADD --debug" [ "$DEBUG" = "true" ] && RPMFORCEADD="$RPMFORCEADD --debug"
[ "$USER_FULLNAME" -a "$USER_EMAIL" ] && RPMUSERADD="--packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
echo "ERROR: new version and changelog can't be specified together" echo "ERROR: new version and changelog can't be specified together"
elif [ "$REBUILDSPECCHANGELOG" ]; then elif [ "$REBUILDSPECCHANGELOG" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild --changelog \"$REBUILDSPECCHANGELOG\"" $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild \
--changelog \"$REBUILDSPECCHANGELOG\" $RPMUSERADD"
elif [ "$UPDATESPECVERSION" ]; then elif [ "$UPDATESPECVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a3,4 $RPMFORCEADD $UPDATESPECVERSION" $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a3,4 $RPMFORCEADD $UPDATESPECVERSION \
$RPMUSERADD"
else else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2:4 $RPMFORCEADD $UPDATESPECVERSION" $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2:4 $RPMFORCEADD $UPDATESPECVERSION \
$RPMUSERADD"
fi fi
RET=$? RET=$?
;; ;;
"speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then "speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
if [ "${SPECCREATEURL/\/}" = "$SPECCREATEURL" ]; then
# local source in /SOURCES
SPECCREATEURL="../SOURCES/$SPECCREATEURL"
fi
AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec" AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec"
#DECODEDURL=`cgi_decodevar $SPECCREATEURL` #DECODEDURL=`cgi_decodevar $SPECCREATEURL`
[ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE" [ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
[ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION" [ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
[ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH" [ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE --changelog \"package created by $USER using the webbuild interface\"" [ "$USER_FULLNAME" -a "$USER_EMAIL" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE \
--changelog \"package created by $USER using the webbuild interface\""
RET=$? RET=$?
[ $RET -eq 0 ] && { [ $RET -eq 0 ] && {
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`" social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`"
@ -1683,9 +1703,9 @@ case $REQUEST in
[ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent <b>$AUTODISTPKGS $SPECVAR_Version-$SPECVAR_Release</b> from <i>`print_environment_descr $ENVIRONMENT`</i> to <b>$SENDREPOSITORY</b>\" STIME=`date +%s`" [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent <b>$AUTODISTPKGS $SPECVAR_Version-$SPECVAR_Release</b> from <i>`print_environment_descr $ENVIRONMENT`</i> to <b>$SENDREPOSITORY</b>\" STIME=`date +%s`"
;; ;;
"autoport") if [ "$AUTOPORTPACKAGE" ]; then "autoport") if [ "$AUTOPORTPACKAGE" ]; then
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY" &>/dev/null $SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY --user $USER" &>/dev/null
RET=$? RET=$?
[ $REQ -eq 0 ] && { [ $RET -eq 0 ] && {
RET=-1 RET=-1
echo "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above." echo "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above."
} }
@ -1768,7 +1788,7 @@ case $REQUEST in
[ $RET -eq 0 ] && { [ $RET -eq 0 ] && {
echo -n "Patch added to sources with name '<b>$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch'</b>." echo -n "Patch added to sources with name '<b>$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch'</b>."
for l in 1 0 2 3; do for l in 1 0 2 3; do
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && patch --dry-run -s -p1 < $SPECVAR_RPMSOURCESDIR/$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch >/dev/null" $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && patch --dry-run -s -p$l < $SPECVAR_RPMSOURCESDIR/$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch >/dev/null"
RET=$? RET=$?
[ $RET -eq 0 ] && break [ $RET -eq 0 ] && break
done done
@ -1776,6 +1796,7 @@ case $REQUEST in
echo -n "<br><font color=lightgreen>Info: good, patch applies successfully with -p$l option!</font>" echo -n "<br><font color=lightgreen>Info: good, patch applies successfully with -p$l option!</font>"
echo -n "<br><br><font color=gold>HINT: add the following lines in the appropriate sections:</font><br>" echo -n "<br><br><font color=gold>HINT: add the following lines in the appropriate sections:</font><br>"
else else
l=0
echo -n "<br><font color=red>Warning: patch does not apply with '-p0' to '-p3' options!</font>" echo -n "<br><font color=red>Warning: patch does not apply with '-p0' to '-p3' options!</font>"
echo "<br><br><font color=gold>HINT: you might want to retry from a clean build dir after pressing the 'unpack' button or check if it applies after changing working subdirectory in build tree.</font>" echo "<br><br><font color=gold>HINT: you might want to retry from a clean build dir after pressing the 'unpack' button or check if it applies after changing working subdirectory in build tree.</font>"
echo -n "<br><font color=gold>HINT: add anyway the following lines in the appropriate sections and press 'prepare' to see patch command output:</font><br>" echo -n "<br><font color=gold>HINT: add anyway the following lines in the appropriate sections and press 'prepare' to see patch command output:</font><br>"
@ -1895,7 +1916,7 @@ case $REQUEST in
echo "ERROR: changelog was not specified." echo "ERROR: changelog was not specified."
RET=1 RET=1
else else
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\"" &>/dev/null $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\" --user $USER" &>/dev/null
[ $? -ne 0 ] && RET=$? || { [ $? -ne 0 ] && RET=$? || {
RET=-1 RET=-1
echo -n "Mass rebuild started. You may see the output in the <b>Webbuild jobs</b> box above." echo -n "Mass rebuild started. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1917,7 +1938,7 @@ case $REQUEST in
fi fi
;; ;;
"autoportnp") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="-f" || AUTODISTADD= "autoportnp") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="-f" || AUTODISTADD=
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport -np $PACKAGE -r $SENDREPOSITORY $AUTODISTADD" &>/dev/null $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport -np $PACKAGE -r $SENDREPOSITORY $AUTODISTADD --user $USER" &>/dev/null
[ $? -ne 0 ] && RET=$? || { [ $? -ne 0 ] && RET=$? || {
RET=-1 RET=-1
echo -n "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above." echo -n "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above."

View File

@ -230,7 +230,8 @@ function parse_patch_output() {
} }
function parse_build_output() { function parse_build_output() {
sed "s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g; sed "s|\r.*||;
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g;
s|&lt;font|<font|g; s|&lt;font|<font|g;
s|&lt;/font|</font|g; s|&lt;/font|</font|g;
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|; s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
@ -243,7 +244,8 @@ function parse_build_output() {
} }
function parse_generic_output() { function parse_generic_output() {
sed "s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g; sed "s|\r.*||;
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g;
s|&lt;font|<font|g; s|&lt;font|<font|g;
s|&lt;/font|</font|g; s|&lt;/font|</font|g;
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|; s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
@ -289,6 +291,15 @@ function print_environment_descr() {
# (${AUTOPORT_BASE_REPOSITORY[$i]} based)" # (${AUTOPORT_BASE_REPOSITORY[$i]} based)"
} }
function environment_rootdir() {
local env=$1
if [ "${AUTOPORT_CHROOT[$env]}" ]; then
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}"
else
echo ""
fi
}
function environment_autoport_logdir() { function environment_autoport_logdir() {
local env=$1 local env=$1
if [ "${AUTOPORT_CHROOT[$env]}" ]; then if [ "${AUTOPORT_CHROOT[$env]}" ]; then
@ -305,12 +316,22 @@ function environment_autoport_logdir() {
function environment_logdir() { function environment_logdir() {
local env=$1 local env=$1
local chroot=$2
if [ "${AUTOPORT_CHROOT[$env]}" ]; then if [ "${AUTOPORT_CHROOT[$env]}" ]; then
if [ "${AUTOPORT_CHROOT_USER[$env]}" != "autodist" ]; then if [ "${AUTOPORT_CHROOT_USER[$env]}" != "autodist" ]; then
if [ "$chroot" ]; then
echo "/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
else
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/" echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
fi
else
if [ "$chroot" ]; then
echo "/var/autodist/log/"
else else
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/var/autodist/log/" echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/var/autodist/log/"
fi fi
fi
elif [ "${AUTOPORT_NATIVE[$env]}" ]; then elif [ "${AUTOPORT_NATIVE[$env]}" ]; then
local envhome=`eval echo ~${AUTOPORT_CHROOT_USER[$env]}` local envhome=`eval echo ~${AUTOPORT_CHROOT_USER[$env]}`
if [ "${AUTOPORT_CHROOT_USER[$env]}" = "autodist" ]; then if [ "${AUTOPORT_CHROOT_USER[$env]}" = "autodist" ]; then

View File

@ -31,11 +31,10 @@ function showlog() {
LOGFILE3=$LOGFILE/*_${PACKAGE/\//_}__*.${AUTOPORT_ARCH[$ENVIRONMENT]} LOGFILE3=$LOGFILE/*_${PACKAGE/\//_}__*.${AUTOPORT_ARCH[$ENVIRONMENT]}
LOGFILE4=$LOGFILE/*_${PACKAGE/\//_}.${AUTOPORT_ARCH[$ENVIRONMENT]} LOGFILE4=$LOGFILE/*_${PACKAGE/\//_}.${AUTOPORT_ARCH[$ENVIRONMENT]}
LOGDIR=`environment_logdir $ENVIRONMENT` LOGDIR=`environment_logdir $ENVIRONMENT 1`
LOGFILES="$LOGDIR/$LOGFILE1 $LOGDIR/$LOGFILE2 $LOGDIR/$LOGFILE3 $LOGDIR/$LOGFILE4" LOGFILES="$LOGDIR/$LOGFILE1 $LOGDIR/$LOGFILE2 $LOGDIR/$LOGFILE3 $LOGDIR/$LOGFILE4"
# sort by most recent and take first # sort by most recent and take first
LOGFILES=`ls -t $LOGFILES 2>/dev/null | head -1` LOGFILES=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $LOGFILES 2>/dev/null | head -1"`
# LOGFILES=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $LOGFILES 2>/dev/null | head -1"`
fi fi
echo -n "<output><![CDATA[<hr><b>Console output for $PACKAGE ($LOGTYPE$LOGSTATUSAPPEND):</b>" echo -n "<output><![CDATA[<hr><b>Console output for $PACKAGE ($LOGTYPE$LOGSTATUSAPPEND):</b>"
echo "<div align=left class=output id=$LOGOUTPUTID>" echo "<div align=left class=output id=$LOGOUTPUTID>"
@ -161,7 +160,7 @@ function print_editorcontrols() {
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">" echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">"
echo -n "<input type=button id=savebutton value=\"save\" onclick=" echo -n "<input type=button id=savebutton value=\"save\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&" echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=savespec&SPECTEXT=\"+encodeURIComponent(editor.getValue()));" echo -n "REQUEST=savespec&SENDREPOSITORY=$SENDREPOSITORY&SPECTEXT=\"+encodeURIComponent(editor.getValue()));"
echo -n "this.disabled=true; disabled=disabled class=redbutton>" echo -n "this.disabled=true; disabled=disabled class=redbutton>"
# specfile reload # specfile reload
echo -n "<input type=button id=updatespecbutton value=\"reload\" onclick=" echo -n "<input type=button id=updatespecbutton value=\"reload\" onclick="
@ -208,7 +207,7 @@ function print_editorcontrols() {
} }
function show_docs() { function show_docs() {
local f RET local f RET ftype
for f in $@; do for f in $@; do
echo -n "<a href=#logfile-$f>$f</a><br>" echo -n "<a href=#logfile-$f>$f</a><br>"
@ -216,6 +215,11 @@ function show_docs() {
echo -n "<br>" echo -n "<br>"
for f in $@; do for f in $@; do
echo -n "<a name=logfile-$f><p style=\"background-color:gray\"><b>File $f:</b></a><pre>" echo -n "<a name=logfile-$f><p style=\"background-color:gray\"><b>File $f:</b></a><pre>"
ftype="`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && file $f"`"
if [ "${ftype/text}" = "${ftype}" ]; then
echo "<p>Binary file; skipping."
continue
fi
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \ $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \
"cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | sed \"s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | sed \"s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
RET=$? RET=$?

View File

@ -32,8 +32,10 @@ elif [ "$MODE" = "finishprocess" ]; then
exit $RETCODE exit $RETCODE
elif [ "$ENVIRONMENT" = "local" ]; then elif [ "$ENVIRONMENT" = "local" ]; then
echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log
$COMMAND 2>&1 | sed "s|<|\&lt;|g" $COMMAND 2>&1
exit 0 # | sed "s|<|\&lt;|g"
RET=$?
exit $RET
fi fi
if [ "$ENVIRONMENT" = "local" ]; then if [ "$ENVIRONMENT" = "local" ]; then