From 74b2c0b27a99000129db54fe31ccde1f787fb981 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 25 Jul 2015 14:47:50 +0200 Subject: [PATCH] Fix for Enter doing search triggering main form. Minor cookie thing fix. --- cgi-bin/webbuild | 757 +++++++++++++++++++++--------------- languages/it_IT.mo | Bin 1847 -> 1862 bytes languages/it_IT.po | 6 +- scripts/jquery.cookiebar.js | 2 +- webbuild.html.inc | 2 +- 5 files changed, 443 insertions(+), 324 deletions(-) diff --git a/cgi-bin/webbuild b/cgi-bin/webbuild index 84e22c6..0929df6 100755 --- a/cgi-bin/webbuild +++ b/cgi-bin/webbuild @@ -1,7 +1,7 @@ #!/bin/bash # # webbuild cgi script -# Copyright (c) 2012-2013 by Silvan Calarco +# Copyright (c) 2012-2015 by Silvan Calarco # . /usr/share/autodist/webbuild-functions . /usr/share/autodist/webbuild-functions-private @@ -14,8 +14,7 @@ cgi_getvars BOTH ALL [ "$PACKAGE" ] && PACKAGEENCODED=`cgi_encodevar "$PACKAGE"` || PACKAGEENCODED= #cgi_getvars POST -if [ "$REQUEST" != "refresh" ]; then -# echo "`date` - $QUERY_STRING_POST" >> $LOG +if [ "${REQUEST:0:7}" != "refresh" ]; then echo "`date` - USER=$USER&REQUEST=$REQUEST&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGE&MAINTAINERMODE=$MAINTAINERMODE" >> $LOG fi @@ -66,7 +65,7 @@ if [ "$USER" ]; then else USER_ENABLED= fi - elif [ "$REQUEST" != "refresh" ]; then + elif [ "${REQUEST:0:7}" != "refresh" ]; then # no "$USER_SECRET" set; require password echo -n " " echo -n " " echo -n " " @@ -197,6 +196,7 @@ if [ "$USER" -a "$USER_ENABLED" ]; then USER_ADMIN= USER_CANMAINTAIN= USER_CANINSTALL= + USER_ENVIRONMENTS= USER_ALLENVIRONMENTS= USER_ALLREPOSITORIES= [ -e $WEBBUILD_STATEDIR/users/$USER.conf ] && . $WEBBUILD_STATEDIR/users/$USER.conf @@ -210,48 +210,53 @@ fi # # Public requests # -if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then - [ -e "$WEBBUILD_STATEDIR/social_log" ] || exit - # social box - echo -n "" - count=0 - if [ ! "$FROMID" -o "$FROMID" = "0" -o "$FROMID" = "NaN" ]; then - if [ "$USER" ]; then - line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " SUSER=$USER " 2>/dev/null | tail -n 25 | head -n 1` - else - line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " STARGET=developers " 2>/dev/null | tail -n 25 | head -n 1` +if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshsocial" -o ! "$USER" ]; then + if [ "$WEBBUILD_URL" -a "${WEBBUILD_URL/\/localhost\//}" = "$WEBBUILD_URL" ]; then + curl -s "$WEBBUILD_URL?REQUEST=refreshsocial&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&FROMID=$FROMID" + else + [ -e "$WEBBUILD_STATEDIR/social_log" ] || exit + # social box + echo -n "" + count=0 + SID=0 + if [ ! "$FROMID" -o "$FROMID" = "0" -o "$FROMID" = "NaN" ]; then + if [ "$USER" ]; then + line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " SUSER=$USER " 2>/dev/null | tail -n 25 | head -n 1` + else + line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " STARGET=developers " 2>/dev/null | tail -n 25 | head -n 1` + fi + eval $line + FROMID=$SID fi - eval $line - FROMID=$SID + 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 "$STARGET" == "developers" ] && continue + if [ "$SPRIVACY" -a ! "$USER" ]; then + USER_GRAVATAR= + else + USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"` + fi + echo -n "
" + echo -n "
" + if [ "$SPRIVACY" -a ! "$USER" ]; then + SUSER="a developer" + elif [ "$USER" = "$SUSER" ]; then + SUSER="you" + fi + echo -n "
$SUSER $STEXT
" + echo -n "

]]>
" + count=$(($count + 1)) + done + echo -n "
" 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 "$STARGET" == "developers" ] && continue - if [ "$SPRIVACY" -a ! "$USER" ]; then - USER_GRAVATAR= - else - USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"` - fi - echo -n "
" - echo -n "
" - if [ "$SPRIVACY" -a ! "$USER" ]; then - SUSER="a developer" - elif [ "$USER" = "$SUSER" ]; then - SUSER="you" - fi - echo -n "
$SUSER $STEXT
" - echo -n "

]]>
" - count=$(($count + 1)) - done - echo -n "
" fi if [ "$USER_ENABLED" != "1" ]; then @@ -340,10 +345,13 @@ if [ "$REQUEST" = "killtree" ]; then killline=`grep "^$KILLPID " $WEBBUILD_STATEDIR/processes` if [ "$killline" ]; then if [ $KILLPID -ge 1 ]; then - [ -e /proc/$KILLPID ] && $SUDO_WRAPPER killtree $KILLPID "$USER" - set -- $killline - rm -f $5 - sed -i "/^$KILLPID /d" $WEBBUILD_STATEDIR/processes + if [ -e /proc/$KILLPID ]; then + $SUDO_WRAPPER killtree $KILLPID "$USER" + else + set -- $killline + rm -f $5 + sed -i "/^$KILLPID /d" $WEBBUILD_STATEDIR/processes + fi else echo "ERROR: Invalid PID" fi @@ -354,7 +362,6 @@ fi # refresh processes list if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then echo -n "Pending admin requests:" while read line; do @@ -375,29 +382,42 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then fi numprocess=0 + tac $WEBBUILD_STATEDIR/processes | \ while read line; do set -- $line RETCODE=$6 + PROCESSLOG=$5 # if [ -e /proc/$1 -o $5 -lt 256 ]; then numprocess=$(($numprocess + 1)) - cmdline=`echo $line | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"` - cmdline=`echo $cmdline | sed "s| --colors web||"` + cmdline=`echo "$line" | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"` + cmdline=`echo "$cmdline" | sed "s| --colors web||"` PACKAGE_ENCODED=`cgi_encodevar $4` [ $numprocess -eq 1 ] && { - echo -n "
" - echo -n "Webbuild jobs: " +# echo -n "
" + u="$(uptime)" + f="$(df / -k -h --output=avail,pcent|tail -n1)" + b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done` + echo -n "Load: ${u/*: } | Disk: $f | " + [ "$b" ] && echo -n "Building now: $b | " + [ "`ps cax|grep smart`" ] && echo "Updating | " if [ "$STATE_JOBSSHOWALL" != "1" ]; then - echo "[ Show all ]" + echo "$USER's jobs: [Show all jobs]" else - echo "[ Show mine only ]" + echo "All jobs: [Only show my jobs]" fi - #echo -n "(please click on [x] to clean your build logs when you are done)" echo -n "
" } [ "$STATE_JOBSSHOWALL" = "1" -o "$USER" = "$2" ] || continue if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then echo -n "\"running...\"" + elif [ ! -e $PROCESSLOG ]; then + sed -i "\,$1 $USER.* $PROCESSLOG ,d" $WEBBUILD_STATEDIR/processes + continue else + if [ $RETCODE -eq 256 ]; then + $SUDO_WRAPPER finishprocess $1 "$USER" $5 + RETCODE=$? + fi if [ $RETCODE -eq 0 ]; then # echo -n "OK" echo -n "\"OK\"" @@ -414,11 +434,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then else echo -n "\"" - echo -n "$cmdline\" " - if [ $RETCODE -eq 256 ]; then - $SUDO_WRAPPER finishprocess $1 "$USER" $5 - RETCODE=$? - fi + echo -n "$cmdline\" (`date -r $5 +'%F %T'`)" fi if [ "$2" = "$USER" -o "$USER_ADMIN" ]; then if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then @@ -433,8 +449,9 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then echo -n "]" fi echo -n "
" - done < $WEBBUILD_STATEDIR/processes - [ $numprocess -gt 0 ] && echo -n "
" + done + +# [ $numprocess -gt 0 ] && echo -n "
" echo -n "]]>
" exit fi @@ -451,14 +468,19 @@ fi # repsearch request if [ "$REQUEST" = "repsearch" ]; then echo -n "Repository search results for \"$REPSEARCHTEXT\":
" - echo -n "
"
-   $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \
-      parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
+   echo -n "
Search results for \"$REPSEARCHTEXT\":
" +# echo -n "
"
+   REPSEARCHTEXT_FMT=`echo "${REPSEARCHTEXT}" | sed "s|[[:space:]]|+|g"`
+   curl -s "${WEBBUILD_DISTROQUERY_URL}?query=${REPSEARCHTEXT_FMT}&search_milestone2=true&search_milestone3=true&search_devel=true\
+&search_i586=true&search_x86_64=true&search_arm=true&search_sources=true&query_compact=true&replyplain=true" | \
+   sed "s| \(href=.\)/| \1${SITE_BASE_URL}/|g"
+#   $SUDO_WRAPPER 0 local "$USER" "" "autodist-repository search -i ${REPSEARCHTEXT/-/\-}" | \
+#      parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
 #      sed "s|\(.*(source).*\)|\1|;
 #           s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|\1|"
-   echo -n "
" - echo "
]]>" +# echo -n "
" + echo "
" + echo "]]>
" exit fi @@ -468,7 +490,7 @@ if [ "$REQUEST" = "environmentsearch" ]; then echo -n "
Environment search results for \"$ENVSEARCHTEXT\":
" echo -n "
"
    echo -n "Installed packages providing '$ENVSEARCHTEXT':
" - WHAT_PROVIDES=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "rpm -q --what-provides \"$ENVSEARCHTEXT\"" | sort -u` + WHAT_PROVIDES=`$SUDO_WRAPPER binary $ENVIRONMENT "$USER" "" "rpm -q --what-provides \"$ENVSEARCHTEXT\"" | sort -u` echo -n "$WHAT_PROVIDES
" if [ "${WHAT_PROVIDES:0:10}" != "no package" ]; then for f in $WHAT_PROVIDES; do @@ -491,10 +513,10 @@ fi # rpm manager if [ "$REQUEST" = "rpmmanager" ]; then - environment_descr=`print_environment_descr $i` + environment_descr=`print_environment_descr $ENVIRONMENT` echo -n "
" - echo -n "
" + echo -n "
" echo -n "RPM manager for $environment_descr environment
" # select rpm manager resource directory to display @@ -526,14 +548,14 @@ if [ "$REQUEST" = "rpmmanager" ]; then rpmmanagerfiles=$rpmmanagerdir/$rpmmanagermask if [ "${rpmmanagermode}" = "environment" ]; then # local files in environment - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $rpmmanagerfiles 2>/dev/null" | \ + $SUDO_WRAPPER binary $ENVIRONMENT "$USER" "" "ls -t $rpmmanagerfiles 2>/dev/null" | \ while read f; do pkgname=`basename $f` echo -n "" done @@ -546,7 +568,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then echo -n "${pkgname} " echo -n "" + echo -n "&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>" echo -n "" echo -n "" done @@ -560,7 +582,8 @@ if [ "$REQUEST" = "rpmmanager" ]; then # rpm manager install packages echo -n "" +# rpm manager +echo -n "" # expert mode checkbox [ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED= echo -n " Autodist:" + print_environment_descr $i + echo -n "" + break + fi + done + elif [ "${AUTOPORT_CHROOT_USER[$i]}" = "$USER" -o "${AUTOPORT_CHROOT_USER[$i]}" = "contrib" -o "$USER_ALLENVIRONMENTS" ]; then echo -n "" @@ -698,14 +736,15 @@ echo -n "]]>" if [ "$MAINTAINERMODE" = "true" ]; then echo -n " " -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 echo -n "" echo -n "" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls *.spec 2>/dev/null| sed \"s|.spec$||\" | sort -f" | while read f; do + $SUDO_WRAPPER binary $ENVIRONMENT "$USER" "" "ls *.spec 2>/dev/null| sed \"s|.spec$||\" | sort -f" | while read f; do specname=${f/.spec} [ "$PACKAGE" = "$specname" ] && SELECTED="selected=\"selected\"" || SELECTED= echo -n "" @@ -726,11 +765,13 @@ fi if [ ! "$REPSEARCHTEXT" ]; then echo -n "Search repositories:" + #" + if [ "$PACKAGE" ]; then - echo -n "$repname" done else @@ -860,18 +901,16 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then #(getElementById('package').selectedIndex);>" echo "" SRPMBUTTONDISABLED="disabled=disabled" - if [ -e $local_ftp/$REPOSITORY ]; then + if [ "$local_ftp" -a -e $local_ftp/$REPOSITORY ]; then if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then - ls $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + ls --color=none $local_ftp/$REPOSITORY/SRPMS.base/ | grep ".src.rpm$" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY fi else - curl $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \ + curl -s $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \ sed "s|.*\.src\.rpm\">\(.*\).*|\1|" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY fi while read f; do -# [ -r $f ] || continue - pkgname=`basename $f` - pkgname=${pkgname%.src.rpm} + pkgname=${f%.src.rpm} pkgrel=${pkgname/*-} pkgname=${pkgname%-$pkgrel} pkgver=${pkgname/*-} @@ -895,10 +934,13 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&" fi echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>" - if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then + if [ "${AUTOPORT_PORT_REPOSITORY[$ENVIRONMENT]}" ]; then echo -n "$BROADCASTMESSAGE"\" STIME=`date +%s`" + social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:"`var2html BROADCASTMESSAGE`"\" STIME=`date +%s`" REQUEST= fi @@ -952,7 +993,11 @@ if [ "$SPECTEXT" ]; then tmpfile=`mktemp --suffix=.webbuildspectmp` echo -n $SPECTEXT | perl -MURI::Escape -e 'print uri_unescape(<>)' > $tmpfile chmod 644 $tmpfile - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${PACKAGE/*\/}.spec" $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 + fi RET=$? [ $RET -eq 0 ] || { echo -n "ERROR: could not save file ${PACKAGE/*\/}.spec! Please report the problem, thanks.
]]>" @@ -971,42 +1016,68 @@ fi if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccreate" -o \ "$REQUEST" = "rebuildspec" -o "$REQUEST" = "renamespec" -o "$REQUEST" = "deletespec" -o \ "$REQUEST" = "autodistprepare" -o "$REQUEST" = "autodistupdate" -o "$REQUEST" = "addpkgnote" ]; then - echo -n "Console output:
" + if [ "$REQUEST" = "speccreate" ]; then + OUTPUTMODE="outputtop" + else + OUTPUTMODE="outputbottom" + fi + echo -n "Console output:
" echo -n "
"
    RET=255
    case $REQUEST in
       "prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
       "updatespec") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-update"
                     [ "$DEBUG" = "true" ] && RPMFORCEADD="$RPMFORCEADD --debug"
+                    [ "$USER_FULLNAME" -a "$USER_EMAIL" ] && RPMUSERADD="--packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
                     if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
                        echo "ERROR: new version and changelog can't be specified together"
                     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
-                       $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
-                       $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
                     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"
-                       [ "$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\""
-                       RET=$?
-                       [ $RET -eq 0 ] && {
-                          social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on $PACKAGE new package in `print_environment_descr $ENVIRONMENT` environment\" STIME=`date +%s`"
-                          # prepare
-                          $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps"
-                          RET=$?
-                          if [ $RET -eq 0 ]; then
-                             REQUEST_NEXT="showbuilddocs"
+                       FOUND_EXISTING=`curl -s "${WEBBUILD_DISTROQUERY_URL}?package=$PACKAGE&search_milestone2=true&search_milestone3=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true&searchbox=false"`
+                       if [ "$FOUND_EXISTING" != "" ]; then
+                          echo -n "
" + echo "ERROR: package already exists, please update from appropriate version:" + echo -n "
Search results for \"$PACKAGE\":$FOUND_EXISTING" + echo -n "
" + RET=1 + continue + else + if [ "${SPECCREATEURL/\/}" = "$SPECCREATEURL" ]; then + # local source in /SOURCES + SPECCREATEURL="../SOURCES/$SPECCREATEURL" fi - #echo "
HINT: don't forget to add build requirements after successful build! Edit specfile and check recreate SRPM before sending the package." - } + 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" + [ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH" + [ "$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 using the webbuild interface\"" + RET=$? + [ $RET -eq 0 ] && { + eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""` + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on $PACKAGE new package in `print_environment_descr $ENVIRONMENT` environment\" STIME=`date +%s`" + # prepare + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\"" + RET=$? + if [ $RET -eq 0 ]; then + : + REQUEST_NEXT="showbuilddocs" + fi + } + fi else echo "ERROR: both source archive URL and name are needed." RET=1 @@ -1033,7 +1104,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr autodistjobs="$AUTODISTJOB" fi [ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" RET=$? ;; "autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= @@ -1042,15 +1113,18 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr AUTODISTADD="$AUTODISTADD --rebuild -- --changelog \"${AUTODISTUPDATECHANGELOG}\"" fi autodistjobs= + if [ "$AUTODISTVERSION" ]; then + AUTODISTVER="\#$AUTODISTVERSION" + fi if [ "$AUTODISTPKGS" ]; then for p in $AUTODISTPKGS; do - autodistjobs="$autodistjobs $AUTODISTJOB/$p" + autodistjobs="$autodistjobs $AUTODISTJOB/$p${AUTODISTVER}" done else - autodistjobs="$AUTODISTJOB" + autodistjobs="$AUTODISTJOB${AUTODISTVER}" fi [ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" RET=$? ;; "addpkgnote") echo "`date +%s` $USER $ENVIRONMENT $PKGNOTE" >> $WEBBUILD_STATEDIR/notes/$PACKAGE.notes; RET=$? ;; @@ -1095,9 +1169,19 @@ if [ "$MAINTAINERMODE" = "true" ]; then echo -n "" echo -n "Recent packages in $REPOSITORY:
" - cat $local_ftp/distromatic/$REPOSITORY/_recent.inc | sed "s|a href=|a target=new href=|g" + if [ "$local_ftp" -a -e $local_ftp/distromatic/$REPOSITORY ]; then + if [ $local_ftp/distromatic/$REPOSITORY/_recent.inc -nt $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY ]; then + cat $local_ftp/distromatic/$REPOSITORY/_recent.inc > $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY + cat $local_ftp/$REPOSITORY/distromatic.log > $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY + fi + else + curl -s $REPS_BASE_URL/distromatic/$REPOSITORY/_recent.inc > $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY + curl -s $REPS_BASE_URL/$REPOSITORY/distromatic.log > $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY + fi + cat $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY | sed "s|a \(href=.\)/|a target=new \1${SITE_BASE_URL}/|g" + echo -n "
Log:
"
-         cat $local_ftp/$REPOSITORY/distromatic.log
+         cat $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY
          echo -n "
" echo -n "" fi echo -n "Current $PACKAGE.spec in build environment:]]>" # else # echo "" @@ -1162,14 +1246,15 @@ fi # operation panel if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" + if [ "$PACKAGE" ]; then + echo -n "Package: $PACKAGE
Version: " + [ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" + echo -n "${SPECVAR_Version[0]}-${SPECVAR_Release[0]}
" + fi showEnvironmentPanel - echo -n "
" - [ "$PACKAGE" ] && { - echo -n "Package: $PACKAGE
Version: " - [ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" || echo -n "0:" - echo -n "${SPECVAR_Version[0]}-${SPECVAR_Release[0]}
" - } - echo -n "Target arch:" for f in i586 arm x86_64 ppc; do SELECTED= if [ "$f" = "$RPMBUILDARCH" ]; then @@ -1180,38 +1265,34 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" done echo -n "" - echo -n "" - echo -n "" + echo -n " " + echo -n " " # destination repository select echo -n "
Send to:" echo -n "
" - [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "
Autodist batch builds:
" + [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "
Autodist batch builds:
" if [ "$PACKAGE" ]; then if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then echo -n "Patch for $PACKAGE:
" @@ -1275,6 +1356,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" fi echo -n "" + if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "${PACKAGE/-/_}" ]; then + echo -n "
You should use autodist for this package!" + fi if [ "$AUTODISTJOB" ]; then echo -n "
Job packages:" echo -n "" @@ -1307,6 +1391,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&" echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&" echo -n "AUTODISTUPDATECHANGELOG=\"+encodeURIComponent(getElementById('autodistupdatechangelog').value)+\"&" + echo -n "AUTODISTVERSION=\"+getElementById('autodistversion').value+\"&" echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistupdate\");>" # autodist build echo -n ""`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "
job to "`\"+" echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "?"`\"); class=redbutton $DISABLED>" - # autodist update changelog - echo -n "Rebuild changelog:" - echo -n "" # autodist schedule - echo -n "
New version: " + echo -n ""`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "
autodist job for automatic update?"`\"); class=boldbutton>" - echo -n "(version:)" + # autodist update changelog + echo -n "
Rebuild changelog:
" + echo -n "" # autodist show schedule echo -n "" @@ -1368,7 +1453,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "
" fi # automatic port - if [ ! "${AUTOPORT_DISABLE[$ENVIRONMENT]}" -a ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + if [ "${AUTOPORT_PORT_REPOSITORY[$ENVIRONMENT]}" ]; then echo -n "Automatic port:" echo -n "
RPM packaging commands:
" - # check for updates - echo -n "" - # unpack - echo -n "" - # build - echo -n "" - # unpackaged files - echo -n "" - # build requirements - echo -n "" + echo -n "
" + ## check for updates + #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 - 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 "$PACKAGE built packages to "`\"+getSelectedValueById('sendrepository')+" - echo -n "\"`cgi_encodevar "?

HINT: does summary look short and good?
${SPECVAR_Name[0]} - ${SPECVAR_Summary[0]}."`\"" - 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 "$PACKAGE source package only to "`\"+getSelectedValueById('sendrepository')+" - echo -n "\"`cgi_encodevar "?

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 "" # add patches - echo -n "
Add patches:" + echo -n "Add patches:" echo -n "" echo -n " pastebin
" - echo -n "URL:" + echo -n "URL:" echo -n "
$PACKAGE-${SPECVAR_Version}-" echo -n ".patch" echo -n "
" @@ -1474,11 +1500,12 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&" echo -n "UPLOADFILENAME=\"+encodeURIComponent(getElementById('fileToUpload').value));>Upload" echo -n "" - echo -n "

" + echo -n "
" # info from package sources + echo -n "
" echo -n "Info from package in the works:
" # show sources - echo -n "" # show patches - echo -n "" + # add a note + echo -n "" + echo -n "" + echo -n "" + echo -n "" # generic info echo -n "
Generic info:
" @@ -1531,7 +1567,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "" # templates - echo -n "" # macros - echo -n "
" + echo -n "
" + fi + echo -n "
Host maintainance:
" + ## run ldconfig + #echo -n "" + + # environment search + echo -n "
Provides:
" + + # system upgrade + echo -n "" + echo -n "]]>" fi echo -n "Write a message to all developers:
" -echo -n "" +echo -n "" -echo -n "" +echo -n "getElementById('broadcastmessage').value=\"\"; value=\"Send\" />" #echo -n "
" +echo -n "
]]>" if [ "$REQUEST" != "" ]; then echo -n "" @@ -1592,23 +1649,23 @@ case $REQUEST in RET=-1 ;; "smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade" - RET=$? - ;; - "runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "/sbin/ldconfig" - RET=$? - ;; - "showpatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;; + RET=$? + ;; + "runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo /sbin/ldconfig" + RET=$? + ;; + "showpatch") $SUDO_WRAPPER binary $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 ;; - "autopatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE auto" + "autopatch") $SUDO_WRAPPER binary $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" + "updatepatch") $SUDO_WRAPPER binary $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`" @@ -1619,11 +1676,11 @@ case $REQUEST in social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist build patch for $PACKAGE\" STIME=`date +%s`" fi ;; "showscheduled") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule"; RET=$? ;; - "schedule") if [ "$SCHEDULEVERSION" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$SCHEDULEVERSION" + "schedule") if [ "$AUTODISTVERSION" ]; then + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$AUTODISTVERSION" 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`" + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job $AUTODISTJOB for update to version $AUTODISTVERSION\" STIME=`date +%s`" fi else $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB" @@ -1647,7 +1704,7 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD" &>/dev/null + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null [ $? -ne 0 ] && RET=$? || { RET=-1 echo "Autodist build start. You may see the output in the Webbuild jobs box above." @@ -1663,7 +1720,7 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD" &>/dev/null + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null [ $? -ne 0 ] && RET=$? || { RET=-1 echo "Autodist install start. You may see the output in the Webbuild jobs box above." @@ -1678,14 +1735,17 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" RET=$? [ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent $AUTODISTPKGS $SPECVAR_Version-$SPECVAR_Release from `print_environment_descr $ENVIRONMENT` to $SENDREPOSITORY\" STIME=`date +%s`" ;; "autoport") if [ "$AUTOPORTPACKAGE" ]; then - $SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY" &>/dev/null + if [ "$AUTOPORTRELEASEREPOSITORY" ]; then + AUTOPORT_APPEND="-d $AUTOPORTRELEASEREPOSITORY" + fi + $SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY $AUTOPORT_APPEND --user $USER" &>/dev/null RET=$? - [ $REQ -eq 0 ] && { + [ $RET -eq 0 ] && { RET=-1 echo "Autoport started. You may see the output in the Webbuild jobs box above." } @@ -1695,7 +1755,11 @@ case $REQUEST in fi ;; "autospecupdatescheck") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2"; RET=$? ;; - "rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps"; RET=$? ;; + "rpmprepare") [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ + RPMARCHADD="--target $RPMBUILDARCH --define=\"cross_target_cpu $RPMBUILDARCH\"" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec $RPMARCHADD --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\"" + RET=$? + ;; "rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build" [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" @@ -1708,14 +1772,19 @@ case $REQUEST in } ;; "srpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--nodeps" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $RPMFORCEADD $PACKAGE.spec" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \ + "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$RPMFORCEADD $PACKAGE.spec" RET=$? ;; "autospeclistcheck") [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5 --list-check --force $RPMARCHADD" RET=$? ;; - "autospecbuildreq") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6" + "autospecbuildreq") + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo /sbin/ldconfig" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6" RET=$? ;; "rpmchecks") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a8"; RET=$? ;; "rpmsimulateinstall") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a7"; RET=$? ;; @@ -1728,10 +1797,12 @@ case $REQUEST in fi ;; "sendpackage") if [ "$SENDREPOSITORY" ]; then if [ "$SENDRECREATESRPM" = "true" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --arch $AUTODISTARCH" RET=$? else - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --arch $AUTODISTARCH" RET=$? fi if [ $RET -eq 0 ]; then @@ -1745,7 +1816,9 @@ case $REQUEST in "sendsource") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--nodeps" if [ "$SENDREPOSITORY" ]; then if [ "$SENDRECREATESRPM" = "true" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent edited $PACKAGE source to $SENDREPOSITORY\" STIME=`date +%s`" @@ -1768,7 +1841,7 @@ case $REQUEST in [ $RET -eq 0 ] && { echo -n "Patch added to sources with name '$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch'." 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 -eq 0 ] && break done @@ -1776,6 +1849,7 @@ case $REQUEST in echo -n "
Info: good, patch applies successfully with -p$l option!" echo -n "

HINT: add the following lines in the appropriate sections:
" else + l=0 echo -n "
Warning: patch does not apply with '-p0' to '-p3' options!" echo "

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." echo -n "
HINT: add anyway the following lines in the appropriate sections and press 'prepare' to see patch command output:
" @@ -1834,7 +1908,7 @@ case $REQUEST in for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= [ "$REPOSITORYFORCE" = "true" ] && FORCEADD="-f" - $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository import $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD $FORCEADD -y" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-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`" @@ -1851,7 +1925,7 @@ case $REQUEST in for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= [ "$REPOSITORYFORCE" = "true" ] && SIMULATEADD="$SIMULATEADD -f" - $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository release $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-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`" @@ -1866,7 +1940,7 @@ case $REQUEST in break } for p in $PACKAGES; do - $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO" + $SUDO_WRAPPER 0 local "$USER" "" "autodist-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO" RET=$? [ $RET -eq 0 ] || break done @@ -1879,7 +1953,7 @@ case $REQUEST in } for p in $PACKAGES; do [ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD= - $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository archive $SENDREPOSITORY $p -y" + $SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-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`" @@ -1895,7 +1969,8 @@ case $REQUEST in echo "ERROR: changelog was not specified." RET=1 else - $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\"" &>/dev/null + SCRIPTARGS=`echo -e $MASSREBUILDBUILDREQ | awk 'BEGIN {FS="\\\\n"} {for(i=1;i<=NF;i++) printf "--buildreq %s ", $i }'` + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\" -s \"$SCRIPTARGS\" --user $USER" &>/dev/null [ $? -ne 0 ] && RET=$? || { RET=-1 echo -n "Mass rebuild started. You may see the output in the Webbuild jobs box above." @@ -1905,6 +1980,18 @@ case $REQUEST in # fi fi ;; + "repositorymassrebuilddependant") + if [ ! "$PACKAGES" ]; then + echo "ERROR: no package(s) selected." + RET=1 + else + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -ud --user $USER" &>/dev/null + [ $? -ne 0 ] && RET=$? || { + RET=-1 + echo -n "Mass rebuild started. You may see the output in the Webbuild jobs box above." + } + fi + ;; "repositorysync") if [ "$REPOSITORY" ]; then $SUDO_WRAPPER background local "$USER" "" "/etc/cron.hourly/10-openmamba-sync-back $REPOSITORY" @@ -1917,7 +2004,7 @@ case $REQUEST in fi ;; "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=$? || { RET=-1 echo -n "Autoport started. You may see the output in the Webbuild jobs box above." @@ -1976,9 +2063,9 @@ case $REQUEST in [ $RET -eq 0 ] && RET=-1 ;; "showpatchfile") OUTPATCHFILE=${PATCHFILE/*\/} case ${OUTPATCHFILE/*.} in - gz|gzip) $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "gunzip -c $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; - bz2) $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "bzcat $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; - *) $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cat $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; + gz|gzip) $SUDO_WRAPPER binary $ENVIRONMENT "$USER" $PACKAGE "gunzip -c $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; + bz2) $SUDO_WRAPPER binary $ENVIRONMENT "$USER" $PACKAGE "bzcat $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; + *) $SUDO_WRAPPER binary $ENVIRONMENT "$USER" $PACKAGE "cat $SPECVAR_RPMSOURCESDIR/$OUTPATCHFILE" | parse_patch_output ;; esac RET=$? [ $RET -eq 0 ] && RET=-1 @@ -2003,18 +2090,10 @@ case $REQUEST in if [ "$installpackages" ]; then if [ "$REQUEST" = "rpmmanagerinstall" ]; then echo "Installing packages: $RPMMANAGERPACKAGES
" - if [ "$rpmmanagermode" = "environment" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd" - else - sudo rpm -i $installpackages $rpmforceadd - fi + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd 2>&1" elif [ "$REQUEST" = "rpmmanagerupgrade" ]; then echo "Upgrading packages: $RPMMANAGERPACKAGES
" - if [ "$rpmmanagermode" = "environment" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd" - else - sudo rpm -U $installpackages $rpmforceadd - fi + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd 2>&1" fi RET=$? else @@ -2055,52 +2134,25 @@ fi if [ "$MAINTAINERMODE" = "true" ]; then echo -n " " echo -n "" + echo "Repository: $REPOSITORY
" showEnvironmentPanel - echo -n "
" + echo -n "

" if [ "$REPOSITORY" ]; then - echo -n "Repository maintenance:
" -# echo -n "select/unselect all" - echo -n "
" - ls $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm | sort -f | while read f; do - [ -r $f ] || continue - pkgname=`basename $f` - pkgname=${pkgname/.src.rpm} - pkgrel=${pkgname/*-} - pkgname=${pkgname/-$pkgrel} - pkgver=${pkgname/*-} - pkgname=${pkgname/-$pkgver} - if [ "$PACKAGE" = "$pkgname" ]; then - SELECTED="selected=\"selected\""; -# REQUEST="changesrpm" - else - SELECTED= - fi - echo -n "" - done - echo -n "
" - echo -n "Origin: $REPOSITORY" - # repository sync - echo -n " $REPOSITORY updates immediately available from public server?"`\"" - echo -n "); class=redbutton>" + # send options + echo -n "Send options:" + # destination repository echo -n "
Destination: " echo -n "
" + # force checkbox + echo -n "" + # simulate checkbox + echo -n "" + # operations box + echo -n "

" + echo -n "Operations on selected packages:
" +# echo -n "select/unselect all" + echo -n "
" + if [ "$local_ftp" -a -e $local_ftp/$REPOSITORY ]; then + if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then + ls --color=none $local_ftp/$REPOSITORY/SRPMS.base/ | grep ".src.rpm$" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + fi + else + curl -s $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \ + sed "s|.*\.src\.rpm\">\(.*\).*|\1|" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + fi + while read f; do + pkgname=${f/.src.rpm} + pkgrel=${pkgname/*-} + pkgname=${pkgname/-$pkgrel} + pkgver=${pkgname/*-} + pkgname=${pkgname/-$pkgver} + if [ "$PACKAGE" = "$pkgname" ]; then + SELECTED="selected=\"selected\""; +# REQUEST="changesrpm" + else + SELECTED= + fi + echo -n "" + done < $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + echo -n "
" + ## repository sync + #echo -n " $REPOSITORY updates immediately available from public server?"`\"" + #echo -n "); class=redbutton>" # repository compare echo -n ""`\"+p+\"`cgi_encodevar " in $REPOSITORY?"`\"" echo -n "); class=redbutton>" # mass rebuild - echo -n ""`\"+p+\"`cgi_encodevar " from $REPOSITORY and send to "`\"+getSelectedValueById('repositoryimportto')+" echo -n "\"`cgi_encodevar "?"`\"" echo -n "); class=redbutton>" - echo -n " Changelog:" + # mass rebuild of dependant packages + echo -n ""`\"+p+\"`cgi_encodevar " in $REPOSITORY and send to "`\"+getSelectedValueById('repositoryimportto')+" + echo -n "\"`cgi_encodevar "?"`\"" + echo -n "); class=redbutton>" + # changelog for mass rebuild + echo -n "
Rebuild changelog:" echo -n "" - # force checkbox - echo -n "" - # simulate checkbox - echo -n "" + # autodist update buildrequirements + echo -n "Add build requirement(s):
" + echo -n "" + echo -n "

" fi echo -n "]]>" fi @@ -2188,15 +2303,17 @@ if [ "$MAINTAINERMODE" = "true" ]; then [ "$REPOSITORY" ] && echo -n "$REPOSITORY " || echo -n "no repository " echo -n "(Maintainer mode)" else - [ "$PACKAGE" ] && { + if [ "$PACKAGE" ]; then echo -n "$PACKAGE " [ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" echo -n "$SPECVAR_Version-$SPECVAR_Release " || echo -n "no package " - echo -n "(" - print_environment_descr $ENVIRONMENT - echo -n ")" - } + else + echo -n "no package " + fi + echo -n "(" + print_environment_descr $ENVIRONMENT + echo -n ")" fi -echo -n " :: openmamba webbuild" +echo -n " :: openmamba webbuild @`hostname`" echo "" diff --git a/languages/it_IT.mo b/languages/it_IT.mo index 34d2bf328ae9f371e288f888327d9c2d206895df..49aff6e7f9aa49cdc1c40c6982829a9544fe6a9d 100644 GIT binary patch delta 76 zcmdnacZ_et6h_rh1_p*bYzz#-Kw5~Mfq@f9s{v_dAZ-Ao1%b55=ADcSn3zl~Hb=9} YVdBkH$V)8COi!%J%+E`m{FTiK0P~{|DgXcg delta 62 zcmX@cx1Ddp6h>7y1_p*bYzz#-K$@AIfq@f9ivww9Agu_b1%b5c=ADcSn3xO=H%GI~ KVVcaw?f?KTF$uH) diff --git a/languages/it_IT.po b/languages/it_IT.po index 5b1c471..50f00d8 100644 --- a/languages/it_IT.po +++ b/languages/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Responsive Theme\n" "Report-Msgid-Bugs-To: bugs@openmamba.org\n" -"POT-Creation-Date: 2015-07-11 21:11+0200\n" +"POT-Creation-Date: 2015-07-11 21:48+0200\n" "PO-Revision-Date: 2014-12-08 16:25+0100\n" "Last-Translator: Silvan Calarco \n" "Language-Team: Italian, Italy\n" @@ -84,7 +84,9 @@ msgstr "Preparazione" #: ../functions.php:243 msgid "This website uses cookies to improve user experience." -msgstr "Questo sito utilizza i cookie per migliorare l'esperienza dell'utente." +msgstr "" +"Questo sito utilizza i cookie per migliorare l'esperienza di navigazione " +"dell'utente." #: ../functions.php:244 msgid "I Understand" diff --git a/scripts/jquery.cookiebar.js b/scripts/jquery.cookiebar.js index 3ef34ce..480ba04 100644 --- a/scripts/jquery.cookiebar.js +++ b/scripts/jquery.cookiebar.js @@ -44,7 +44,7 @@ append: false, //Set to true for cookieBar HTML to be placed at base of website. Actual position may change according to CSS fixed: true, //Set to true to add the class "fixed" to the cookie bar. Default CSS should fix the position bottom: true, //Force CSS when fixed, so bar appears at bottom of website - zindex: '10', //Can be set in CSS, although some may prefer to set here + zindex: '100', //Can be set in CSS, although some may prefer to set here domain: String(window.location.hostname), //Location of privacy policy referrer: String(document.referrer) //Where visitor has come from }; diff --git a/webbuild.html.inc b/webbuild.html.inc index 1eedead..8e89854 100644 --- a/webbuild.html.inc +++ b/webbuild.html.inc @@ -1,7 +1,7 @@ Caricamento in corso, attendere...
-
+ build automatici    - Webbuild - Interfaccia Web per lo sviluppo di openmamba