diff --git a/webbuild/html/scripts/socialbox.js b/webbuild/html/scripts/socialbox.js index ad27228..eab809f 100644 --- a/webbuild/html/scripts/socialbox.js +++ b/webbuild/html/scripts/socialbox.js @@ -1,10 +1,42 @@ var url = "/cgi-bin/webbuild.cgi" -function ajax_getvalues_refresh(request) { +function socialbox_refresh_times() { + var times = document.getElementsByName("socialtime"); + var datenow = new Date(); + var utcnow = parseInt(Date.UTC(datenow.getUTCFullYear(), datenow.getUTCMonth(), datenow.getUTCDate(), + datenow.getUTCHours(), datenow.getUTCMinutes(), datenow.getUTCSeconds()) / 1000); + for (var i = 0; i < times.length; i++) { + if (times[i].attributes[0].name == "time") { + var socialtime = times[i].attributes[0].value; + } else { + var socialtime = times[i].attributes[1].value; + } + var timeago = utcnow - socialtime; + var daysago = parseInt(timeago / 86400); + var hoursago = parseInt(timeago / 3600 % 24); + var minutesago = parseInt(timeago / 60 % 60); + var secondsago = parseInt(timeago % 60); + times[i].innerHTML = "("; + if (daysago > 1) times[i].innerHTML += daysago + " days"; + else if (daysago == 1) times[i].innerHTML += "1 day, " + hoursago + " hours"; + else if (hoursago > 1) times[i].innerHTML += hoursago + " hours"; + else if (hoursago == 1) times[i].innerHTML += "1 hour, " + minutesago + " minutes"; + else if (minutesago > 1) times[i].innerHTML += minutesago + " minutes"; + else if (minutesago == 1) times[i].innerHTML += "1 minute, " + secondsago + " seconds"; + else times[i].innerHTML += secondsago + " seconds"; + times[i].innerHTML += " ago) "; + } +} + +function ajax_getvalues_refresh(request,user,user_email,secret) { + var fromid = 0; + if (document.getElementsByName("social").length > 0) { + fromid = parseInt(document.getElementsByName("social")[0].attributes[1].value) + 1; + } if (request != "") - request=request+"&REQUEST=refresh"; + request=request+"&REQUEST=refresh&USER="+user+"&USER_EMAIL="+user_email+"&SECRET="+secret+"&FROMID="+fromid; else - request="REQUEST=refresh"; + request="REQUEST=refresh&USER="+user+"&USER_EMAIL="+user_email+"&SECRET="+secret+"&FROMID="+fromid; if (window.XMLHttpRequest) xmlhttp1 = new XMLHttpRequest(); @@ -20,11 +52,18 @@ function ajax_getvalues_refresh(request) { return; } var xmldoc = xmlhttp1.responseXML.documentElement; - if (xmldoc.getElementsByTagName("socialbox").length >0) { - document.getElementById("socialbox").innerHTML = xmldoc.getElementsByTagName("socialbox")[0].childNodes[0].nodeValue; - $(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); }); + var nodes = xmldoc.getElementsByTagName("socialbox")[0].childNodes; + for (var i = 0; i < nodes.length; i++) { + id = nodes[i].attributes[0].value; + document.getElementById("socialbox").innerHTML = + "" + nodes[i].childNodes[0].nodeValue + "" + + document.getElementById("socialbox").innerHTML; } - lastupdate = (+new Date()); + if (document.getElementById("processes") != undefined) + document.getElementById("processes").innerHTML = xmldoc.getElementsByTagName("processes")[0].childNodes[0].nodeValue; + $(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); }); +// lastupdate = (+new Date()); + socialbox_refresh_times(); } xmlhttp1.open("POST", url, true); xmlhttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded"); diff --git a/webbuild/html/scripts/webbuild.js b/webbuild/html/scripts/webbuild.js index 7311c2f..ae12621 100644 --- a/webbuild/html/scripts/webbuild.js +++ b/webbuild/html/scripts/webbuild.js @@ -8,7 +8,8 @@ function getCheckedValuesByName(checkboxname) { return p; } -function getSelectedValueById(selectname) { +function getSelectedValueById(selectname,idx) { + if (idx == undefined) idx = 0; var i=document.getElementById(selectname).selectedIndex; - return document.getElementById(selectname).options[i].value; + return document.getElementById(selectname).options[i+idx].value; } diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index a672678..7626d28 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -6,6 +6,28 @@ . /etc/sysconfig/autoport . /usr/share/autodist/webbuild-functions +function print_environment_descr() { + local i=$1 + + if [ "${AUTOPORT_CHROOT_USER[$i]}" ]; then + echo -n "${AUTOPORT_CHROOT_USER[$i]} " + else + echo -n "autodist " + fi + if [ "${AUTOPORT_UPDATE[$i]}" ]; then + echo -n "autoupdate" + elif [ "${AUTOPORT_CHROOT[$i]}" ]; then + echo -n "chroot" + elif [ "${AUTOPORT_NATIVE[$i]}" ]; then + echo -n "native" + elif [ "${AUTOPORT_CROSS[$i]}" ]; then + echo -n "cross" + else + echo -n "unknown type" + fi + echo -n " for ${AUTOPORT_ARCH[$i]} (${AUTOPORT_BASE_REPOSITORY[$i]} based)" +} + # register all GET and POST variables cgi_getvars BOTH ALL @@ -25,6 +47,7 @@ fi if [ "$AS_HOST" = "0" ]; then echo -e "Content-type: text/xml\nPragma: no-cache\n" +# echo -e "Content-Length: 10485\n" echo -n "" else echo -e "Content-type: text/html; charset=UTF-8\n" @@ -62,18 +85,18 @@ if [ "$SECRET" -a "$USER" ]; then elif [ "$REQUEST" = "password" ]; then /usr/libexec/webbuild-checkpassword "$PASSWORD" "$SECRET" 2>/dev/null if [ $? -eq 0 ]; then - tmpfile=`mktemp` + tmpfile=`mktemp --suffix=webbuildtmp` cat $WEBBUILD_STATEDIR/users/$USER.conf > $tmpfile echo "USER_SECRET='$SECRET'" >> $tmpfile USER_ENABLED=1 - $SUDO_WRAPPER 0 local "" "mv $tmpfile $WEBBUILD_STATEDIR/users/$USER.conf" + $SUDO_WRAPPER 0 local "$USER" "" "mv $tmpfile $WEBBUILD_STATEDIR/users/$USER.conf" else USER_ENABLED= fi else # no "$USER_SECRET" set; require password echo -n "" - echo -n " " echo -n "]]>" @@ -109,7 +132,7 @@ if [ "$USER_ENABLED" != "1" ]; then echo -n "Your request is pending for approval. Please try again later or ask the maintainer in case of problems." else echo -n "" echo -n "]]>" fi @@ -168,60 +191,53 @@ if [ "$USER" -a "$USER_ENABLED" ]; then STATE_ADVANCEDCONTROLS= [ -e $WEBBUILD_STATEDIR/users/$USER.state ] && . $WEBBUILD_STATEDIR/users/$USER.state fi +else + USER= fi # # Public requests # if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then + [ -e "$WEBBUILD_STATEDIR/social_log" ] || exit # social box - echo -n "
" + echo -n "" count=0 - [ -e "$WEBBUILD_STATEDIR/social_log" ] && tail -n 100 $WEBBUILD_STATEDIR/social_log | tac | while read line; do + if [ ! "$FROMID" -o "$FROMID" = "0" -o "$FROMID" = "NaN" ]; then + if [ "$USER" ]; then + line=`tac $WEBBUILD_STATEDIR/social_log | grep -v " SUSER=$USER " | head -n 25 | tail -n 1` + else + line=`tac $WEBBUILD_STATEDIR/social_log | grep -v " STARGET=developers " | head -n 25 | tail -n 1` + fi + eval $line + FROMID=$SID + fi + tail -n 100 $WEBBUILD_STATEDIR/social_log | while read line; do STYPE= SPRIVACY= SUSER= + STARGET= + SID= eval $line + [ "$SID" ] || continue + [ $SID -ge $FROMID ] || continue + [ "$STARGET" = "developers" -a ! "$USER" ] && continue [ "$SUSER" = "$USER" -a "$STYPE" != "broadcastmessage" ] && continue if [ "$SPRIVACY" -a ! "$USER" ]; then USER_GRAVATAR= else USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"` fi - echo -n "
" - echo -n "
" - DATENOW=`date +%s` - DAYSAGO=`expr \( $DATENOW - $STIME \) / 86400` - HOURAGO=`expr \( $DATENOW - $STIME \) / 3600 % 24` - MINAGO=`expr \( $DATENOW - $STIME \) / 60 % 60` - SECAGO=`expr \( $DATENOW - $STIME \) % 60` - TIMEAGO="${SECAGO}s" - if [ $DAYSAGO -gt 1 ]; then - TIMEAGO="$DAYSAGO days" - elif [ $DAYSAGO -eq 1 ]; then - TIMEAGO="1 day ${HOURAGO} hours" - elif [ $HOURAGO -gt 1 ]; then - TIMEAGO="${HOURAGO} hours" - elif [ $HOURAGO -eq 1 ]; then - TIMEAGO="1 hour ${MINAGO} min" - elif [ $MINAGO -gt 1 ]; then - TIMEAGO="${MINAGO} minutes" - elif [ $MINAGO -eq 1 ]; then - TIMEAGO="1 min ${SECAGO} seconds" - else - TIMEAGO="${SECAGO} seconds" - fi + echo -n "" + echo -n "
" if [ "$SPRIVACY" -a ! "$USER" ]; then SUSER="A developer" fi - echo -n "
$SUSER $STEXT (${TIMEAGO} ago)

" + echo -n "
$SUSER $STEXT

" + echo -n "

]]>" count=`expr $count + 1` - [ $count -ge 10 ] && break - echo -n "

" done - echo -n "" - echo -n "]]>
" + echo -n "" fi if [ "$USER_ENABLED" != "1" ]; then @@ -233,51 +249,49 @@ fi # Enabled users requests # +# kill processes or clean log if [ "$REQUEST" = "killtree" ]; then killline=`grep "^$KILLPID " $WEBBUILD_STATEDIR/processes` if [ "$killline" ]; then if [ $KILLPID -ge 1 ]; then - $SUDO_WRAPPER killtree $KILLPID -# if [ $? -eq 0 ]; then - set -- $killline - rm -f $4 - sed -i "/^$KILLPID /d" $WEBBUILD_STATEDIR/processes -# else -# echo "ERROR: killtree returned $?" -# fi + [ -e /proc/$KILLPID ] && $SUDO_WRAPPER killtree $KILLPID "$USER" + set -- $killline + rm -f $5 + sed -i "/^$KILLPID /d" $WEBBUILD_STATEDIR/processes else echo "ERROR: Invalid PID" fi fi - echo -n "
" - exit + REQUEST=refresh fi +# refresh processes list if [ "$REQUEST" = "refresh" ]; then echo -n "" - echo -n "Webbuild jobs:
" + echo -n "Webbuild jobs: (please click on [x] to clean your build logs when you are done)
" } - echo -n "$2 " + echo -n "$2 on `print_environment_descr $3`: " if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then - echo -n "\"" - echo -n "$cmdline\" " + echo -n "\"" + echo -n "$cmdline\" " echo -n "(running...)" else - echo -n "\"" - echo -n "$cmdline\" " + echo -n "\"" + echo -n "$cmdline\" " if [ $RETCODE -eq 256 ]; then - $SUDO_WRAPPER finishprocess $1 $4 + $SUDO_WRAPPER finishprocess $1 "$USER" $5 RETCODE=$? fi if [ $RETCODE -eq 0 ]; then @@ -286,14 +300,18 @@ if [ "$REQUEST" = "refresh" ]; then echo -n "ERROR ($RETCODE)" fi fi - echo -n " [" - if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then - echo -n "kill" - else - echo -n "x" + if [ "$2" = "$USER" -o "$USER_ADMIN" ]; then + if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then + echo -n " [" + echo -n "kill" + else + echo -n " [" + echo -n "x" + fi + echo -n "]" fi - echo -n "]" echo -n "
" # fi done < $WEBBUILD_STATEDIR/processes @@ -314,105 +332,27 @@ fi # repsearch request if [ "$REQUEST" = "repsearch" ]; then echo -n "" + echo -n "
Console output:
" echo -n "
"
-   $SUDO_WRAPPER 0 local "" "openmamba-repository search -i $REPSEARCHTEXT"
+   $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i $REPSEARCHTEXT"
    echo -n "
" echo "
]]>
" exit fi -# ENVIRONMENT select -echo -n "" -# expert mode checkbox -[ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED= -echo -n " Expert:" -# privacy mode checkbox -[ "$STATE_PRIVACYMODE" ] && CHECKED="checked=checked" || CHECKED= -echo -n " Privacy:" -echo -n "" -# maintainer mode checkbox -if [ "$USER_CANMAINTAIN" ]; then - [ "$MAINTAINERMODE" = "true" ] && CHECKED="checked" - echo -n "Maintainer:" -fi -# switch user select -if [ "$USER_ADMIN" -o "$STATE_FAKEUSER" ]; then - echo -n " | " - echo -n " Test user: " -fi -if [ "$MAINTAINERMODE" != "true" ]; then -# [ "$USER_CANMAINTAIN" -o "$STATE_FAKEUSER" -o "$USER_ADMIN" ] && echo -n "
" - echo -n "
Build environment:" -fi -echo -n "]]>
" - -if [ ! "$ENVIRONMENT" ]; then - ENVIRONMENT=$DEFAULT_ENVIRONMENT + [ "$ENVIRONMENT" ] || ENVIRONMENT=$DEFAULT_ENVIRONMENT fi if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then @@ -432,17 +372,17 @@ else AUTOPORTLOGDIR="/var/autodist/.autoport/${AUTOPORT_ARCH[$ENVIRONMENT]}/" fi -if [ "$HOST_IS_X86_64" -a "${AUTOPORT_ARCH[$ENVIRONMENT]}" != "x86_64" ]; then - SUDO_WRAPPER="linux32 $SUDO_WRAPPER" -fi - # show log -if [ "$REQUEST" = "showlog" ]; then - echo -n "Console output:" if [ "$LOGTYPE" = "processoutput" -o "$LOGTYPE" = "processtail" ]; then LOGFILES=$LOGFILE else - LOGFILE=$LOGTYPE + case $LOGTYPE in + autoupdate) LOGFILE=update ;; + buildinstall|rebuild) LOGFILE=build ;; + *) LOGFILE=$LOGTYPE ;; + esac if [ "$LOGSTATUSOK" = "true" ]; then LOGFILE=$LOGFILE/ok else @@ -457,40 +397,130 @@ if [ "$REQUEST" = "showlog" ]; then echo "
" for f in $LOGFILES; do [ -r $f ] || continue - echo -n "`basename $f` (`stat -c %y $f`)
"
+      LOGFILESIZE=`stat -c %s $f`
+      echo -n "`basename $f` (`stat -c %y $f`; $LOGFILESIZE)
"
       if [ "$LOGTYPE" = "processtail" ]; then
          echo -n ""
          tail -n +0 -f $f --pid $PROCESSPID | sed "s|<|\<|g"
          echo -n ""
       else
-         cat $f | sed "s|<|\<|g"
+         if [ $LOGFILESIZE -lt 64512 ]; then
+            cat $f | parse_build_output $PACKAGE
+#            sed "s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
+#                          s|^\([\+#] .*\)|\1|;
+#                          s|\(.*error[[:space:]]*:[[:space:]]*\)\(.*\)|\1\2|i;
+#                          s|^\([%?=][%!=>] .*\)|\1|" | google_search $PACKAGE
+##                          s|\(.*error[[:space:]]*:.*\)|\1|i;
+         else
+            head -c 31744 $f | parse_build_output $PACKAGE
+#            sed "s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
+#                          s|^\([\+#] .*\)|\1|;
+#                          s|\(.*error[[:space:]]*:.*\)|\1|i;
+#                          s|^\([%?=][%!=>] .*\)|\1|"
+            echo "
<------ CUT (long file) ------->" + tail -c 31744 $f | parse_build_output $PACKAGE +# sed "s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g; +# s|^\([\+#] .*\)|\1|; +# s|\(.*error[[:space:]]*:\)\(.*\)|\1\2|i; +# s|^\([%?=][%!=>] .*\)|\1|" + fi fi echo -n "
" done echo -n "
]]>
" - echo -n "" - exit + if [ "$REQUEST" = "autobuildedit" ]; then + REQUEST=edit + else + echo -n "" + exit + fi fi -[ "$PACKAGE" -a ! "$REQUEST" ] && REQUEST=edit +echo -n "" +# expert mode checkbox +[ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED= +echo -n " Expert:" +# privacy mode checkbox +[ "$STATE_PRIVACYMODE" ] && CHECKED="checked=checked" || CHECKED= +echo -n " Privacy:" +echo -n "" +# maintainer mode checkbox +if [ "$USER_CANMAINTAIN" ]; then + [ "$MAINTAINERMODE" = "true" ] && CHECKED="checked" + echo -n "Maintainer:" +fi +# switch user select +if [ "$USER_ADMIN" -o "$STATE_FAKEUSER" ]; then + echo -n " | " + echo -n " Test user: " +fi +echo -n "]]>" -# SPECFILES select -if [ "$ENVIRONMENT" -a "$MAINTAINERMODE" != "true" ]; then +if [ "$HOST_IS_X86_64" -a "${AUTOPORT_ARCH[$ENVIRONMENT]}" != "x86_64" ]; then + SUDO_WRAPPER="linux32 $SUDO_WRAPPER" +fi + +if [ "$MAINTAINERMODE" = "true" ]; then + echo -n " " + echo -n " " +elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "prepare" ]; then + echo -n "Build environment:" + echo -n "]]>" + # SPECFILES select echo -n "" echo -n "" - for f in `$SUDO_WRAPPER 0 $ENVIRONMENT "" "ls *.spec"`; do + for f in `$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls *.spec"`; do specname=${f/.spec} [ "$PACKAGE" = "$specname" ] && SELECTED="selected=\"selected\"" || SELECTED= echo -n "" done echo -n "]]>" -elif [ "$MAINTAINERMODE" = "true" ]; then - echo -n " " fi +[ "$PACKAGE" -a ! "$REQUEST" ] && REQUEST=edit + # clean output when changing environment if [ ! "$REPOSITORY" -a ! "$PACKAGE" -a ! "$REQUEST" = "repsearch" ]; then echo -n " " @@ -501,7 +531,7 @@ fi # REPOSITORIES search if [ ! "$REPSEARCHTEXT" ]; then echo -n "" if [ "$PACKAGE" ]; then @@ -512,11 +542,11 @@ if [ ! "$REPSEARCHTEXT" ]; then echo -n "]]>" fi -if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then +if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$MAINTAINERMODE" = "true" ]; then # REPOSITORIES select if [ "$MAINTAINERMODE" = "true" -o ! "$REPOSITORY" -o "$REQUEST" = "changeenvironment" ]; then echo -n "" echo -n "" - for f in `$SUDO_WRAPPER 0 local "" "/usr/sbin/openmamba-repository list"`; do + for f in `$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/openmamba-repository list"`; do repname=`basename $f` [ "$repname" = "$REPOSITORY" ] && SELECTED="selected=selected" || SELECTED= - echo -n "" + if [ "$MAINTAINERMODE" = "true" -a ! "$USER_ALLREPOSITORIES" ]; then + for u in $USER_CANMAINTAIN_REPOSITORIES devel-$USER; do + [ "$u" = "$repname" ] && echo -n "" + done + else + echo -n "" + fi done echo -n "" echo -n "]]>" + echo -n " " echo -n " " echo -n " " fi +else + echo -n "" + echo -n " \" onclick=" + echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&" + 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 " ]]>" + echo -n " " + echo -n " " + echo -n " " +fi +if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then # PACKAGES (SRPM) select if [ "$REQUEST" = "changerepository" -o "$REQUEST" = "switchmaintainermode" -a "$MAINTAINERMODE" != "true" ]; then echo -n "" #(getElementById('package').selectedIndex);>" echo "" @@ -564,18 +638,17 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then echo -n "]]>" if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then - echo -n "" fi echo -n "]]>" -# REQUEST=changesrpm fi fi @@ -590,7 +663,7 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then done echo -n "" echo -n " version:" - echo -n ")' > $tmpfile chmod 644 $tmpfile - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cat $tmpfile > $PACKAGE.spec" $tmpfile + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cat $tmpfile > $PACKAGE.spec" $tmpfile rm -f $tmpfile fi if [ "$REQUEST" = "edit" -o "$REQUEST" = "prepare" ]; then - social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"is working on $PACKAGE\" STIME=`date +%s`" + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on $PACKAGE\" STIME=`date +%s`" fi # Here requests which update the specfile, so editor is refreshed after if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccreate" -o \ - "$REQUEST" = "rebuildspec" -o "$REQUEST" = "renamespec" -o "$REQUEST" = "deletespec" ]; then - echo -n "" + "$REQUEST" = "rebuildspec" -o "$REQUEST" = "renamespec" -o "$REQUEST" = "deletespec" -o \ + "$REQUEST" = "autodistprepare" -o "$REQUEST" = "autodistupdate" ]; then + echo -n "Console output:
" echo -n "
"
    RET=255
    case $REQUEST in
-      "prepare") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
-      "updatespec") if [ "$UPDATESSPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
+      "prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
+      "updatespec") if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
                        echo "ERROR: new version and changelog can't be specified together"
                     elif [ "$REBUILDSPECCHANGELOG" ]; then
-                       $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a4 --rebuild --changelog \"$REBUILDSPECCHANGELOG\""
+                       $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a4 --rebuild --changelog \"$REBUILDSPECCHANGELOG\""
                     elif [ "$UPDATESSPECVERSION" ]; then
-                       $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a3,4 $UPDATESPECVERSION"
+                       $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a3,4 $UPDATESPECVERSION"
                     else
-                       $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a2:4 $UPDATESPECVERSION"
+                       $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a2:4 $UPDATESPECVERSION"
                     fi
                     RET=$?
-                    [ ;;
+                    ;;
       "speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
                        AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec"
                        #DECODEDURL=`cgi_decodevar $SPECCREATEURL`
                        [ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
                        [ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
-                       $SUDO_WRAPPER 0 $ENVIRONMENT "" "autospec -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE"
+                       $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autospec -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE"
                        RET=$?
-                       [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"is working on $PACKAGE new package\" STIME=`date +%s`"
+                       [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on $PACKAGE new package\" STIME=`date +%s`"
 #                          --changelog \"package created by $USER from autodist webbuild interface\""
                     else
                        echo "ERROR: both source archive URL and name are needed."
                        RET=1
                     fi
                     ;;
-      "renamespec") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "mv $RENAMESPECFROM.spec $PACKAGE.spec && sed -i \"s|\(Name:[[:space:]]*\).*|\1$PACKAGE|\" $PACKAGE.spec"
+      "renamespec") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "mv $RENAMESPECFROM.spec $PACKAGE.spec && sed -i \"s|\(Name:[[:space:]]*\).*|\1$PACKAGE|\" $PACKAGE.spec"
                     RET=$?
-                    [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"renamed $RENAMESPECFROM to $PACKAGE\" STIME=`date +%s`"
+                    [ $RET -eq 0 ] && {
+                       social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"renamed $RENAMESPECFROM to $PACKAGE\" STIME=`date +%s`"
+                       echo "Specfile $RENAMESPECFROM successfully renamed to $PACKAGE."
+                    }
                     ;;
-      "deletespec") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "rm -f $PACKAGE.spec"
+      "deletespec") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rm -f $PACKAGE.spec"
                     RET=$?
                     [ $RET -eq 0 ] && REQUEST="exit"
                     ;;
+      "autodistprepare") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
+                    autodistjobs=
+                    if [ "$AUTODISTPKGS" ]; then
+                       for p in $AUTODISTPKGS; do
+                          autodistjobs="$autodistjobs $AUTODISTJOB/$p"
+                       done
+                    else
+                       autodistjobs="$AUTODISTJOB"
+                    fi
+                    $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD"
+                    RET=$?
+                    ;;
+      "autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
+                    autodistjobs=
+                    if [ "$AUTODISTPKGS" ]; then
+                       for p in $AUTODISTPKGS; do
+                          autodistjobs="$autodistjobs $AUTODISTJOB/$p"
+                       done
+                    else
+                       autodistjobs="$AUTODISTJOB"
+                    fi
+                    $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD"
+                    RET=$?
+                    ;;
    esac
    echo -n "
" if [ $RET -eq 0 ]; then @@ -707,26 +808,31 @@ if [ "$MAINTAINERMODE" = "true" ]; then echo -n "
Log:
"
          cat $local_ftp/$REPOSITORY/distromatic.log
          echo -n "
" - echo -n "" echo -n "]]>" else echo -n " " fi + REQUEST= fi fi +if [ "$REQUEST" = "changerepository" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "changeenvironment" ]; then + REQUEST= +fi + # specfile editor if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" -o "$REQUEST" = "switchmaintainermode" -a "$MAINTAINERMODE" != "true" ]; then if [ "$PACKAGE" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "ls $PACKAGE.spec" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "ls $PACKAGE.spec" [ $? -eq 0 ] && SPECAVAILABLE=1 fi if [ "$SPECAVAILABLE" ]; then echo -n "$PACKAGE.spec in build environment:" # specfile save - echo -n "" # specfile reload - echo -n "" + echo -n "REQUEST=reloadspec\"" + echo -n ",\"`cgi_encodevar "Reload $PACKAGE.spec?

Warning: current unsaved .spec file changes will be lost."`\");>" # specfile rename - echo -n "" echo -n ".spec" # specfile delete - echo -n "$PACKAGE.spec?"`\")>" echo -n "]]>" @@ -771,6 +878,31 @@ fi # operation panel if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" + if [ "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" ]; then + echo -n "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]} " + else + echo -n "autodist " + fi + if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + echo -n "autoupdate" + elif [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then + echo -n "chroot" + elif [ "${AUTOPORT_NATIVE[$ENVIRONMENT]}" ]; then + echo -n "native" + elif [ "${AUTOPORT_CROSS[$ENVIRONMENT]}" ]; then + echo -n "cross" + else + echo -n "unknown type" + fi + echo -n " for ${AUTOPORT_ARCH[$ENVIRONMENT]}" + # smart upgrade + echo -n "" + + echo -n "
" [ "$PACKAGE" ] && echo -n "Package: $PACKAGE
" echo -n "Target arch:" - for f in `$SUDO_WRAPPER 0 local "" "/usr/sbin/openmamba-repository list"`; do + for f in `$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/openmamba-repository list"`; do repname=`basename $f` if [ "$repname" = "devel-${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" -o \ "$repname" = "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" -o \ @@ -804,44 +936,39 @@ if [ "$MAINTAINERMODE" != "true" ]; then [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "
Autodist batch builds:
" if [ "$PACKAGE" ]; then if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + echo -n "Patch for $PACKAGE:
" # autodist show patch - echo -n "Patch:" # autodist remove patch - echo -n "$PACKAGE?"`\"); class=redbutton>" + # autodist auto patch + echo -n "$PACKAGE?
Note: patch type will be autodetected."`\"); class=redboldbutton>" # autodist update patch - echo -n "update patch for package $PACKAGE?"`\"); class=redbutton>" # autodist build patch - echo -n "build patch for package $PACKAGE?"`\"); class=redbutton>" - # autodist show schedule - echo -n "
Schedule:" - # autodist schedule - echo -n "$PACKAGE autodist job for automatic update?"`\"); class=redbutton>" - # autodist unschedule - echo -n "" - # autodist skip - echo -n "
" fi fi - if [ "$STATE_ADVANCEDCONTROLS" ]; then + if [ "$STATE_ADVANCEDCONTROLS" -o "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then # autodist list-jobs + [ "$PACKAGE" -a "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ] && echo -n "
" echo -n "Job:" if [ "$AUTODISTJOB" ]; then echo -n "
Job packages:
" - for p in `$SUDO_WRAPPER 0 $ENVIRONMENT "" "autodist --list-pkgs $AUTODISTJOB"`; do + for p in `$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist --list-pkgs $AUTODISTJOB"`; do if [ "$AUTODISTPKGS" ]; then for i in $AUTODISTPKGS; do [ "$i" = "$p" ] && { SELECTED=checked; break; } || SELECTED= @@ -914,7 +1041,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&" echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&" echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&" - echo -n "ENVIRONMENT=$ENVIRONMENT&PACKAGE=$PACKAGEENCODED&REQUEST=autodistinstall\"); class=redbutton $DISABLED>" + echo -n "ENVIRONMENT=$ENVIRONMENT&PACKAGE=$PACKAGEENCODED&REQUEST=autodistinstall\"" + echo -n ",\"`cgi_encodevar "Install built packages for "`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar " job in current environment?"`\"" + echo -n "); class=redbutton $DISABLED>" # autodist send [ ! "$USER_ALLREPOSITORIES" ] && DISABLED="disabled=disabled" || DISABLED= echo -n ""`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar " job to "`\"+" echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "?"`\"); class=redbutton $DISABLED>" + # autodist schedule + echo -n "
"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar " autodist job for automatic update?"`\"); class=boldbutton>" + echo -n "(version:)" + # autodist show schedule + echo -n "" + # autodist unschedule + echo -n "" + # autodist skip + echo -n "
" else echo -n "
" fi + # automatic port + if [ ! "${AUTOPORT_DISABLE[$ENVIRONMENT]}" -a ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + echo -n "
Automatic port:" + echo -n "$PACKAGE package with current specfile changes?"`\"); class=redbutton>" + echo -n "" + fi fi if [ "$PACKAGE" ]; then if [ "$STATE_ADVANCEDCONTROLS" -o "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then @@ -937,69 +1095,63 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "
Last autodist logs: " echo -n "OK " echo -n "FAILED
" - echo -n "" - echo -n "" - echo -n "" - echo -n "" - echo -n "" fi echo -n "
RPM packaging commands:
" # check for updates - echo -n "" # unpack - echo -n "" # build - echo -n "" - # buildroot files - echo -n "" # unpackaged files - echo -n "" # build requirements - echo -n "" # recreate SRPM - echo -n "" # rpm checks - echo -n "" - echo -n "" # rpm install [ ! "$USER_CANINSTALL" ] && DISABLED="disabled=disabled" - echo -n "$PACKAGE in current environment?"`\"" echo -n "); class=redbutton $DISABLED>" # rpm send - echo -n "$PACKAGE built packages to "`\"+getSelectedValueById('sendrepository')+" echo -n "\"`cgi_encodevar "?"`\"" echo -n "); class=redbutton>" # recreate and send SRPM - echo -n "" # add patches echo -n "
Add patches:" - echo -n "
" echo -n "URL:" echo -n "As: $PACKAGE-.patch" - if [ ! "${AUTOPORT_DISABLE[$ENVIRONMENT]}" -a ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then - echo -n "
Automatic port:
" - echo -n "" - echo -n "" - fi - echo -n "
Info from package sources:
" - echo -n "Info from package in the works:
" + # source files + echo -n "" - echo -n "" - echo -n "" - echo -n "" - echo -n "" + # show package configure help + echo -n "" + # show package configure log + echo -n "" + # buildroot files + echo -n "" + # show package changelog + echo -n "" + + # generic info echo -n "
Generic info:
" - echo -n "" - echo -n "" - echo -n "
" @@ -1054,21 +1218,20 @@ fi echo -n "Broadcast message:
" +echo -n "
Message to developers:
" echo -n "" -echo -n "" echo -n "]]>
" if [ "$REQUEST" != "" ]; then - echo -n "Console output:" echo -n "
" else echo -n "id=outputtop>" @@ -1080,60 +1243,55 @@ if [ "$REQUEST" != "" ]; then fi case $REQUEST in - "showpatch") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;; - "removepatch") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE remove" + "smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade" + RET=$? + ;; + "showpatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;; + "removepatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE remove" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"removed the autodist patch for $PACKAGE\" STIME=`date +%s`" fi ;; - "updatepatch") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE update" + "autopatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE auto" + RET=$? + if [ $RET -eq 0 ]; then + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist patch for $PACKAGE\" STIME=`date +%s`" + fi ;; + "updatepatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE update" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist update patch for $PACKAGE\" STIME=`date +%s`" fi ;; - "buildpatch") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE build" + "buildpatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE build" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist build patch for $PACKAGE\" STIME=`date +%s`" fi ;; - "showscheduled") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool schedule"; RET=$? ;; - "schedule") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool schedule $PACKAGE" + "showscheduled") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule"; RET=$? ;; + "schedule") if [ "$SCHEDULEVERSION" ]; then + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$SCHEDULEVERSION" + RET=$? + if [ $RET -eq 0 ]; then + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job $AUTODISTJOB for update to version $SCHEDULEVERSION\" STIME=`date +%s`" + fi + else + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB" + RET=$? + if [ $RET -eq 0 ]; then + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job $PAUTODISTJOB for automatic update\" STIME=`date +%s`" + fi + fi + ;; + "unschedule") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool unschedule $AUTODISTJOB" RET=$? if [ $RET -eq 0 ]; then - social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job $PACKAGE\" STIME=`date +%s`" + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"unscheduled autodist job $AUTODISTJOB\" STIME=`date +%s`" fi ;; - "unschedule") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool unschedule $PACKAGE" - RET=$? - if [ $RET -eq 0 ]; then - social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"unscheduled autodist job $PACKAGE\" STIME=`date +%s`" - fi ;; - "skip") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autodist-tool skip $PACKAGE" + "skip") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool skip $AUTODISTJOB" RET=$? if [ $RET -eq 0 ]; then - social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"added autodist job $PACKAGE to skipped list\" STIME=`date +%s`" + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"added autodist job $AUTODISTJOB to skipped list\" STIME=`date +%s`" fi ;; - "autodistprepare") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= - autodistjobs= - if [ "$AUTODISTPKGS" ]; then - for p in $AUTODISTPKGS; do - autodistjobs="$autodistjobs $AUTODISTJOB/$p" - done - else - autodistjobs="$AUTODISTJOB" - fi - $SUDO_WRAPPER 0 $ENVIRONMENT "" "autodist -v -p $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" - RET=$? ;; - "autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= - autodistjobs= - if [ "$AUTODISTPKGS" ]; then - for p in $AUTODISTPKGS; do - autodistjobs="$autodistjobs $AUTODISTJOB/$p" - done - else - autodistjobs="$AUTODISTJOB" - fi - $SUDO_WRAPPER 0 $ENVIRONMENT "" "autodist -v -u $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" - RET=$? ;; "autodistbuild") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= autodistjobs= if [ "$AUTODISTPKGS" ]; then @@ -1143,7 +1301,7 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER background $ENVIRONMENT "" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" RET=$? #[ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"successfully built $PACKAGE\" STIME=`date +%s`" ;; @@ -1156,7 +1314,7 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER 0 $ENVIRONMENT "" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH $AUTODISTADD" RET=$? ;; "autodistsend") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= autodistjobs= @@ -1167,71 +1325,67 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER 0 $ENVIRONMENT "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH $AUTODISTADD" RET=$? - [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent $PACKAGE to $SENDREPOSITORY\" STIME=`date +%s`" + [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent $AUTODISTPKGS to $SENDREPOSITORY\" STIME=`date +%s`" ;; - "autoport") $SUDO_WRAPPER background $ENVIRONMENT $PACKAGE "autoport $PACKAGE -r $REPOSITORY -v" + "autoport") $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport $PACKAGE -r $REPOSITORY -v" RET=$? ;; - "buildrootfiles") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cd @RPMBUILDROOT@ && find @BUILDROOT@"; RET=$? ;; - "autospecupdatescheck") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a2"; RET=$? ;; - "rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "rpmbuild -bp $PACKAGE.spec"; RET=$? ;; - "rpmbuild") echo "`date` - RPMBUILD=$PACKAGE USER=$USER ENVIRONMENT=$ENVIRONMENT" >> $WEBBUILD_STATEDIR/buildingnow_log - [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build" - [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ - RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" - $SUDO_WRAPPER background $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a5,6 $RPMFORCEADD $RPMARCHADD" -# && echo \"Webbuild HINT: now you may want to click on 'build requirements', add build requirements in .spec file and then 'recreate SRPMS'\"" - RET=$? -# if [ $RET -eq 0 ]; then -# social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"successfully built $PACKAGE\" STIME=`date +%s`" -# fi - sed -i "|RPMBUILD=$PACKAGE USER=$USER ENVIRONMENT=$ENVIRONMENT|d" $WEBBUILD_STATEDIR/buildingnow_log - ;; - "srpmbuild") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "rpmbuild -bs $PACKAGE.spec" + "buildrootfiles") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd @RPMBUILDROOT@ && find @BUILDROOT@"; RET=$? ;; + "autospecupdatescheck") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a2"; RET=$? ;; + "rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps"; RET=$? ;; + "rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build" + [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ + RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" + $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a5,6 $RPMFORCEADD $RPMARCHADD" +# && echo \"Webbuild HINT: now you may want to click on 'build requirements', add build requirements in .spec file and then 'recreate SRPMS'\"" + RET=$? + ;; + "srpmbuild") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir @WORKINGHOME@/RPM/SOURCES\" $PACKAGE.spec" RET=$? ;; "autospeclistcheck") [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a5 --list-check $RPMARCHADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a5 --list-check $RPMARCHADD" RET=$? ;; - "autospecbuildreq") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a6" + "autospecbuildreq") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a6" RET=$? ;; - "rpmchecks") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a8"; RET=$? ;; - "rpmsimulateinstall") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a7"; RET=$? ;; + "rpmchecks") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a8"; RET=$? ;; + "rpmsimulateinstall") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a7"; RET=$? ;; "rpminstall") if [ "$USER_CANINSTALL" ]; then [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-install" - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a11 $RPMFORCEADD"; RET=$? + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a11 $RPMFORCEADD"; RET=$? else echo "Install function disabled." RET=1 fi ;; - "addpatch") if [ "$ADDPATCHURL" -a "$ADDPATCHNAME" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "curl -s -k \"$ADDPATCHURL\" -o ../SOURCES/$PACKAGE-$ADDPATCHNAME.patch" - RET=$? - [ $RET -eq 0 ] && echo "Patch added with name $PACKAGE-$ADDPATCHNAME.patch" - else - echo "Patch URL or destination name not provided." - RET=1 - fi ;; - "sendpackage") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a10 --server $SENDREPOSITORY" + "sendpackage") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autospec -u $PACKAGE -a10 --server $SENDREPOSITORY" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent $PACKAGE to $SENDREPOSITORY\" STIME=`date +%s`" fi ;; "sendsource") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force --nodeps" if [ "$SENDREPOSITORY" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "rpmbuild -bs $PACKAGE.spec $RPMFORCEADD && autospec -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir @WORKINGHOME@/RPM/SOURCES\" $PACKAGE.spec $RPMFORCEADD && autospec -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" RET=$? else echo "ERROR: send repository is not defined." RET=255 fi ;; + "addpatch") if [ "$ADDPATCHURL" -a "$ADDPATCHNAME" ]; then + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "curl -skL \"$ADDPATCHURL\" -o ../SOURCES/$PACKAGE-$ADDPATCHNAME.patch" + RET=$? + [ $RET -eq 0 ] && echo "Patch added with name $PACKAGE-$ADDPATCHNAME.patch" + else + echo "Patch URL or destination name not provided." + RET=1 + fi ;; "repositoryimport") for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= - $SUDO_WRAPPER 0 local "$PACKAGE" "openmamba-repository import $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y" + [ "$REPOSITORYFORCE" = "true" ] && FORCEADD="-f" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository import $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD $FORCEADD -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"imported $p from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" @@ -1242,7 +1396,8 @@ case $REQUEST in "repositoryrelease") for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= - $SUDO_WRAPPER 0 local "$PACKAGE" "openmamba-repository release $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y" + [ "$REPOSITORYFORCE" = "true" ] && SIMULATEADD="$SIMULATEADD -f" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository release $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"released $p from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" @@ -1252,7 +1407,7 @@ case $REQUEST in ;; "repositorydiff") for p in $PACKAGES; do - $SUDO_WRAPPER 0 local "" "openmamba-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO" + $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO" RET=$? [ $RET -eq 0 ] || break done @@ -1260,7 +1415,7 @@ case $REQUEST in "repositoryarchive") for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= - $SUDO_WRAPPER 0 local "$PACKAGE" "openmamba-repository archive $SENDREPOSITORY $p -y" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository archive $SENDREPOSITORY $p -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"archived $p from $SENDREPOSITORY\" STIME=`date +%s`" @@ -1270,23 +1425,23 @@ case $REQUEST in ;; "repositorysync") if [ "$REPOSITORY" ]; then - $SUDO_WRAPPER background local "" "/etc/cron.hourly/20-openmamba-apt $REPOSITORY" + $SUDO_WRAPPER background local "$USER" "" "/etc/cron.hourly/20-openmamba-apt $REPOSITORY" RET=$? - [ $RET -eq 0 ] && $SUDO_WRAPPER background local "" "/etc/cron.hourly/40-openmamba-rsync $REPOSITORY" + [ $RET -eq 0 ] && $SUDO_WRAPPER background local "$USER" "" "/etc/cron.hourly/40-openmamba-rsync $REPOSITORY" RET=$? [ $RET -eq 0 ] || break fi ;; - "autoportnp") $SUDO_WRAPPER keeplog $ENVIRONMENT $PACKAGE "autoport -np $PACKAGE"; RET=$? ;; + "autoportnp") $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport -v -np $PACKAGE"; RET=$? ;; "autoportlog") cat "$AUTOPORTLOGDIR/current.log"; RET=$? ;; - "allowedgroups") $SUDO_WRAPPER 0 $ENVIRONMENT "" "autospec --eval rpm_allowed_groups"; RET=$? ;; - "approvedlicenses") $SUDO_WRAPPER 0 $ENVIRONMENT "" "autospec --eval rpm_approved_licenses | grep -v \"^#\"" | \ + "allowedgroups") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autospec --eval rpm_allowed_groups"; RET=$? ;; + "approvedlicenses") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autospec --eval rpm_approved_licenses | grep -v \"^#\"" | \ while read line; do echo $line done RET=0 ;; - "builddirfiles") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cd @RPMBUILDDIR@ && find @BUILDDIR@"; RET=$? ;; + "builddirfiles") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd @RPMBUILDDIR@ && find @BUILDDIR@"; RET=$? ;; "showchangelogs"|"showbuilddocs"|"showlicenses") if [ "$REQUEST" = "showchangelogs" ]; then PATTERN="-iname changelog -or -iname news -and -type f" @@ -1295,7 +1450,7 @@ case $REQUEST in elif [ "$REQUEST" = "showbuilddocs" ]; then PATTERN="-iname readme\* -or -iname install\* -or -iname todo\* -or -iname pkgbuild\* -and -type f" fi - files=`$SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && find . $PATTERN -maxdepth 2"` + files=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && find . $PATTERN -maxdepth 2"` cnt=0 for f in $files; do echo -n "$f
" @@ -1303,13 +1458,16 @@ case $REQUEST in echo -n "
" for f in $files; do echo -n "

File $f:

"
-                          $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && cat $f"
+                          $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \
+                             "cd @RPMBUILDDIR@/@BUILDDIR@ && head -c 10240 $f | sed \"s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | \
+                             tee /tmp/prova5
                           RET=$?
                           echo -n "
" done ;; - "configurehelp") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && ./configure --help"; RET=$? ;; - "showmacrosfile") $SUDO_WRAPPER 0 $ENVIRONMENT $PACKAGE "cat /etc/rpm/macros.$MACROSFILE"; RET=$? ;; + "configurehelp") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && ./configure --help"; RET=$? ;; + "configurelog") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd @RPMBUILDDIR@/@BUILDDIR@ && cat config.log"; RET=$? ;; + "showmacrosfile") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cat /etc/rpm/macros.$MACROSFILE"; RET=$? ;; *) RET=0 ;; esac @@ -1331,7 +1489,7 @@ if [ "$MAINTAINERMODE" = "true" ]; then echo -n "Repository maintenance:
" -# echo -n "
" # repository compare - echo -n "" # repository import - echo -n ""`\"+p+\"`cgi_encodevar " from $REPOSITORY to "`\"+getSelectedValueById('repositoryimportto')+" echo -n "\"`cgi_encodevar "?"`\"" echo -n "); class=redbutton>" # repository release - echo -n ""`\"+p+\"`cgi_encodevar " in $REPOSITORY to "`\"+getSelectedValueById('repositoryimportto')+" echo -n "\"`cgi_encodevar "?"`\"" echo -n "); class=redbutton>" # repository archive - echo -n ""`\"+p+\"`cgi_encodevar " in $REPOSITORY?"`\"" echo -n "); class=redbutton>" + echo -n "" echo -n "" # repository sync - echo -n " \1|; + s|\(.*error[[:space:]]*:[[:space:]]*\)\(.*\)|\1\2|i; + s|^\(== =.*\)|\1|; + s|^[[:cntrl:]]*\([!%?=][!%!=>] .*\)|\1|;" | google_search $1 +} + +function google_search() { + while read line; do + local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|"` + if [ "$SEARCH_STRING" = "$line" ]; then + echo "$line" + else + SEARCH_STRING=`echo $SEARCH_STRING | sed "s|\<|<|"` + local SEARCH_STRING_ENCODED=`cgi_encodevar "$1 $SEARCH_STRING"` + echo "$line" | sed "s|%SRCURL%.*%SRCURLEND%|href=\"http://www.google.com/search?q=$SEARCH_STRING_ENCODED\" target=_new title=\"Search this error on the Web\"|" + fi + done +} diff --git a/webbuild/webbuild-sudo b/webbuild/webbuild-sudo index c66f4dd..5d1975e 100755 --- a/webbuild/webbuild-sudo +++ b/webbuild/webbuild-sudo @@ -4,23 +4,32 @@ MODE=$1 ENVIRONMENT=$2 -PACKAGE=$3 -COMMAND=$4 -TMPFILE=$5 +USER=$3 +PACKAGE=$4 +COMMAND=$5 +TMPFILE=$6 +echo "REQUEST: $@" >> $WEBBUILD_STATEDIR/commands_log if [ "$MODE" = "killtree" ]; then KILLPID=$2 - [ $KILLPID -gt 1 ] && kill_tree $KILLPID + [ $KILLPID -gt 1 ] && { + echo "COMMAND: kill_tree $KILLPID" >> $WEBBUILD_STATEDIR/commands_log + kill_tree $KILLPID + } exit $? elif [ "$MODE" = "finishprocess" ]; then PROCESSPID=$2 - PROCESSLOG=$3 - RETCODE=`tail -n1 $PROCESSLOG | grep "^# WEBBUILD_EXITCODE=" | sed "s|^# WEBBUILD_EXITCODE=||"` - [ "$RETCODE" ] || RETCODE=257 - sed -i "s|\(^$PROCESSPID [^[:space:]]* [^[:space:]]* [^[:space:]]* \)[^[:space:]]*|\1$RETCODE|" $WEBBUILD_STATEDIR/processes + PROCESSLOG=$4 + if [ -e $PROCESSLOG ]; then + RETCODE=`tail -n1 $PROCESSLOG | grep "^# WEBBUILD_EXITCODE=" | sed "s|^# WEBBUILD_EXITCODE=||"` + [ "$RETCODE" ] || RETCODE=257 + else + RETCODE=0 + fi + sed -i "s|\(^$PROCESSPID [^[:space:]]* [^[:space:]]* [^[:space:]]* [^[:space:]]* \)[^[:space:]]*|\1$RETCODE|" $WEBBUILD_STATEDIR/processes exit $RETCODE elif [ "$ENVIRONMENT" = "local" ]; then -# echo "Command: $COMMAND" + echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log $COMMAND 2>&1 | sed "s|<|\<|g" exit 0 fi @@ -57,7 +66,7 @@ if [ "$WORKINGHOME" ]; then eval `$SUCMDPREFIX "autospec --eval=tmppath_dir|grep -v '^#'"` RPMBUILDROOT=$tmppath_dir SPECFILE=${ENVPREFIX}${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec - if [ -r "$SPECFILE" ]; then + if [ "$PACKAGE" -a -r "$SPECFILE" ]; then rm -f $SPECFILE.tmp $SUCMDPREFIX "rpm -q --specfile ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec --specedit > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null" if [ -e $SPECFILE.tmp ]; then @@ -76,23 +85,24 @@ COMMAND=`echo $COMMAND | sed "s|@BUILDDIR@|$BUILDDIR|g"` COMMAND=`echo $COMMAND | sed "s|@BUILDROOT@|$BUILDROOT|g"` COMMAND=`echo $COMMAND | sed "s|@RPMBUILDDIR@|$RPMBUILDDIR|g"` COMMAND=`echo $COMMAND | sed "s|@RPMBUILDROOT@|$RPMBUILDROOT|g"` +COMMAND=`echo $COMMAND | sed "s|@WORKINGHOME@|$WORKINGHOME|g"` +echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log -cmdtmpfile=`mktemp` -chgrp nobody $cmdtmpfile -chmod 640 $cmdtmpfile +cmdtmpfile=`mktemp --suffix=.webbuildcmd` +[ "$PACKAGE" ] || PACKAGE=nopackage if [ "$MODE" = "background" ]; then if [ "$WORKINGHOME" ]; then $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | sed "s|<|\<|g" | tr -d '\f' > $cmdtmpfile & else $SUCMDPREFIX "$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 | sed "s|<|\<|g" | tr -d '\f' > $cmdtmpfile & fi - echo "$! $ENVUSER $ENVIRONMENT $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes + echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes echo "Started background command: $COMMAND" RET=0 else - echo "$$ $ENVUSER $ENVIRONMENT $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes - rettmpfile=`$SUCMDPREFIX mktemp` + echo "$$ $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes + rettmpfile=`$SUCMDPREFIX "mktemp --suffix=.webbuildret"` if [ "$WORKINGHOME" ]; then $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \$? > $rettmpfile" 2>&1 | sed "s|<|\<|g" | tr -d '\f' | tee $cmdtmpfile else @@ -101,11 +111,11 @@ else RET=`cat $ENVPREFIX/$rettmpfile` [ "$RET" ] || RET=255 $SUCMDPREFIX "rm -f $rettmpfile" - sed -i "/^$$ $ENVUSER/d" $WEBBUILD_STATEDIR/processes + sed -i "/^$$ $USER/d" $WEBBUILD_STATEDIR/processes if [ "$MODE" != "keeplog" ]; then rm -f $cmdtmpfile else - echo "$$ $ENVUSER $ENVIRONMENT $cmdtmpfile $RET $COMMAND" >> $WEBBUILD_STATEDIR/processes + echo "$$ $USER $ENVIRONMENT $PACKAGE $cmdtmpfile $RET $COMMAND" >> $WEBBUILD_STATEDIR/processes fi fi @@ -114,4 +124,8 @@ if [ "$ENVIRONMENT" != "local" ]; then rm -f /var/autoport/${AUTOPORT_CHROOT[$ENVIRONMENT]}/$TMPFILE fi fi +if [ -e $cmdtmpfile ]; then + chmod 666 $cmdtmpfile + chown apache.nobody $cmdtmpfile +fi exit $RET