From dcff130bdfd4e5de38eaeeb2092f62fc3e25502f Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 6 Sep 2012 18:55:33 +0200 Subject: [PATCH] webbuild-cgi: support for public social box and other fixes and improvements --- webbuild/webbuild-cgi | 680 +++++++++++++++++++++++++++--------------- 1 file changed, 447 insertions(+), 233 deletions(-) diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index 1f62bc6..9f2d305 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -11,6 +11,34 @@ LOG=/var/autodist/webbuild/access_log DEFAULT_ENVIRONMENT=0 [ "`uname -m`" = "x86_64" ] && HOST_IS_X86_64=1 +function set_user_state_var() { + local statevar=$1 + local statevalue=$2 + local stateuser=$3 + + [ ! "$stateuser" ] && stateuser=$USER + + [ "$1" ] || return + + [ -e $STATEDIR/users/$stateuser.state ] || touch $STATEDIR/users/$stateuser.state + sed -i "/^$statevar=/d" $STATEDIR/users/$stateuser.state + [ "$statevalue" ] && echo "$statevar=$statevalue" >> $STATEDIR/users/$stateuser.state +} + +function social_log() { + local line=$1 + + [ "$1" ] || return + + if [ ! "$STATE_FAKEUSER" ]; then + STATE_SOCIALLOG_ID=0 + . $STATEDIR/users/webbuild.state + STATE_SOCIALLOG_ID=`expr $STATE_SOCIALLOG_ID + 1` + set_user_state_var STATE_SOCIALLOG_ID $STATE_SOCIALLOG_ID webbuild + echo "SID=$STATE_SOCIALLOG_ID SPRIVACY=$STATE_PRIVACYMODE $line" >> $STATEDIR/social_log + fi +} + function cgi_encodevar() { local string="${1}" local strlen=${#string} @@ -144,10 +172,12 @@ fi # SECURITY USER_ENABLED= +USER_ADMIN= +USER_CANIMPORT= USER=${USER/.*\/} if [ "$SECRET" -a "$USER" ]; then - if [ -r "$STATEDIR/users/$USER" ]; then - . $STATEDIR/users/$USER + if [ -r "$STATEDIR/users/$USER.conf" ]; then + . $STATEDIR/users/$USER.conf fi if [ "$USER_ENABLED" ]; then USER_ENABLED= @@ -172,10 +202,10 @@ if [ "$SECRET" -a "$USER" ]; then /usr/libexec/webbuild-checkpassword "$PASSWORD" "$SECRET" 2>/dev/null if [ $? -eq 0 ]; then tmpfile=`mktemp` - cat $STATEDIR/users/$USER > $tmpfile + cat $STATEDIR/users/$USER.conf > $tmpfile echo "USER_SECRET='$SECRET'" >> $tmpfile USER_ENABLED=1 - $SUDO_WRAPPER local "" "mv $tmpfile $STATEDIR/users/$USER" + $SUDO_WRAPPER local "" "mv $tmpfile $STATEDIR/users/$USER.conf" else USER_ENABLED= fi @@ -222,90 +252,205 @@ if [ "$USER_ENABLED" != "1" ]; then echo -n "ajax_getvalues(\"REQUEST=enablerequest\");>" echo -n "]]>" fi - else - echo -n "Unauthorized!" +# else +# echo -n "Unauthorized!" fi echo -n " " - echo -n "" - exit +# echo -n "" +# exit fi -echo -n "
" -count=0 -[ -e "$STATEDIR/social_log" ] && tail -n 100 $STATEDIR/social_log | tac | while read line; do - STYPE= - eval $line - [ "$SUSER" = "$USER" -a "$STYPE" != "broadcastmessage" ] && continue - USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"` - echo -n "
" - echo -n "
" - DATENOW=`date +%s` - HOURAGO=`expr \( $DATENOW - $STIME \) / 3600` - MINAGO=`expr \( $DATENOW - $STIME \) / 60 % 60` - SECAGO=`expr \( $DATENOW - $STIME \) % 60` - TIMEAGO="${SECAGO}s" - [ $MINAGO -gt 0 -o $HOURAGO -gt 0 ] && TIMEAGO="${MINAGO}m $TIMEAGO" - [ $HOURAGO -gt 0 ] && TIMEAGO="${HOURAGO}h $TIMEAGO" - echo -n "
$SUSER $STEXT (${TIMEAGO} ago)

" -# echo -n "$SUSER $STEXT (${TIMEAGO} ago)
" - count=`expr $count + 1` - [ $count -ge 10 ] && break - echo -n "

" -done -echo -n "
" -echo -n "]]>
" +if [ -e $STATEDIR/webbuild.state ]; then + . $STATEDIR/users/webbuild.state +else + touch $STATEDIR/users/webbuild.state +fi -if [ "$REQUEST" = "refresh" ]; then - echo "" - exit +if [ "$USER_ADMIN" -a "$FAKEUSERSWITCH" != "" ]; then + if [ "$FAKEUSERSWITCH" = "_disabled_" ]; then + set_user_state_var STATE_FAKEUSER + FAKEUSER= + else + set_user_state_var STATE_FAKEUSER $FAKEUSERSWITCH + fi +fi + +if [ "$USER" -a "$USER_ENABLED" ]; then + + # set user state changes + if [ "$ADVANCEDCONTROLSSWITCH" != "" ]; then + if [ "$ADVANCEDCONTROLSSWITCH" = "true" ]; then + set_user_state_var STATE_ADVANCEDCONTROLS 1 + else + set_user_state_var STATE_ADVANCEDCONTROLS + fi + fi + if [ "$PRIVACYMODESWITCH" != "" ]; then + if [ "$PRIVACYMODESWITCH" = "true" ]; then + set_user_state_var STATE_PRIVACYMODE 1 + else + set_user_state_var STATE_PRIVACYMODE + fi + fi + + # read user state file + [ -e $STATEDIR/users/$USER.state ] && . $STATEDIR/users/$USER.state + + if [ "$USER_ADMIN" -a "$STATE_FAKEUSER" != "" ]; then + USER=$STATE_FAKEUSER + USER_ENABLED= + USER_ADMIN= + USER_CANIMPORT= + USER_CANINSTALL= + USER_ALLENVIRONMENTS= + USER_ALLREPOSITORIES= + [ -e $STATEDIR/users/$USER.conf ] && . $STATEDIR/users/$USER.conf + STATE_ADVANCEDCONTROLS= + [ -e $STATEDIR/users/$USER.state ] && . $STATEDIR/users/$USER.state + fi +fi + +# social box +if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then + echo -n "
" + count=0 + [ -e "$STATEDIR/social_log" ] && tail -n 100 $STATEDIR/social_log | tac | while read line; do + STYPE= + SPRIVACY= + SUSER= + eval $line + [ "$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 + if [ "$SPRIVACY" -a ! "$USER" ]; then + SUSER="A developer" + fi + echo -n "
$SUSER $STEXT (${TIMEAGO} ago)

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

" + done + echo -n "
" + echo -n "]]>
" + + if [ ! "$USER_ENABLED" -o "$REQUEST" = "refresh" ]; then + echo "" + exit + fi fi # ENVIRONMENT select echo -n "" -echo "" +if [ "$USER_CANIMPORT" ]; then + [ "$MAINTAINERMODE" = "true" ] && CHECKED="checked" + echo -n "Maintainer mode: " +fi +if [ "$USER_ADMIN" -o "$STATE_FAKEUSER" ]; then + echo -n " Test user: " + echo -n " | " +fi +# new session button +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 "" +if [ "$MAINTAINERMODE" != "true" ]; then +# [ "$USER_CANIMPORT" -o "$STATE_FAKEUSER" -o "$USER_ADMIN" ] && echo -n "
" + echo -n "
Build environment:" + done + echo -n "" +fi echo -n "]]>
" if [ ! "$ENVIRONMENT" ]; then @@ -373,109 +518,105 @@ if [ ! "$REPSEARCHTEXT" ]; then echo -n "]]>" fi -# REPOSITORIES select -if [ ! "$REPOSITORY" ]; then - echo -n "" - echo -n "" - for f in `$SUDO_WRAPPER local "" "/usr/sbin/openmamba-repository list"`; do - repname=`basename $f` - echo -n "" - done - echo -n "" - if [ "$USER_CANIMPORT" ]; then - [ "$MAINTAINERMODE" = "true" ] && CHECKED="checked" - echo -n "maintainer mode " - fi - echo -n "]]>" - echo -n " " - echo -n " " -fi - -# PACKAGES (SRPM) select -if [ "$REPOSITORY" -a "$REQUEST" = "changerepository" ]; then - echo -n "" - echo "" - for f in $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm; 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= +if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$MAINTAINERMODE" = "true" ]; then + # REPOSITORIES select + if [ ! "$REPOSITORY" -o "$REQUEST" = "changeenvironment" ]; then + echo -n "${pkgname} ${pkgver}-${pkgrel}" - done - echo -n "" - echo "]]>" - REQUEST=changesrpm -fi + echo -n "&PACKAGE=$PACKAGEENCODED&REQUEST=changerepository\");>" + echo -n "" + for f in `$SUDO_WRAPPER local "" "/usr/sbin/openmamba-repository list"`; do + repname=`basename $f` + echo -n "" + done + echo -n "" + echo -n "]]>" + echo -n " " + echo -n " " + fi -# SPECFILE creation -if [ ! "$REQUEST" ]; then - echo -n "" - echo -n " name:" - echo -n " type:" - echo -n " version:" - echo -n "" - echo "]]>" -fi - -if [ "$REQUEST" = "changesrpm" ]; then - if [ "$PACKAGE" ]; then + # PACKAGES (SRPM) select + if [ "$REPOSITORY" -a "$REQUEST" = "changerepository" ]; then + echo -n "" +# i=getElementById('repository').selectedIndex;ajax_getvalues(\"REQUEST=changesrpm&" +# echo -n "ENVIRONMENT=$ENVIRONMENT&MAINTAINERMODE=\"+getElementById('maintain').checked+\"&" +# echo -n "PACKAGE=\"+encodeURIComponent(this.value)+\"&" +# echo -n "REPOSITORY=\"+getElementById('repository').options[i].text);>" + echo "" + for f in $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm; 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 "]]>" echo -n "" + echo -n "PACKAGE=\"+encodeURIComponent(getElementById('package').options[j].value)); disabled=disabled>" fi - echo "]]>" - REQUEST="edit" - else - echo " " + echo -n "]]>" +# if [ "$MAINTAINERMODE" = "true" ]; then +# PACKAGE= +# echo " " +# fi + REQUEST=changesrpm fi -elif [ "$REQUEST" = "changespec" ]; then + + # SPECFILE creation + if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -a "$MAINTAINERMODE" != "true" ]; then + echo -n "" + echo -n " name:" + echo -n " type:" + echo -n " version:" + echo -n "" + echo "]]>" + elif [ "$MAINTAINERMODE" = "true" ]; then + echo -n " " + fi +else + echo -n " " +fi +if [ "$REQUEST" = "changespec" ]; then if [ "$PACKAGE" ]; then REQUEST="edit"; fi elif [ "$REQUEST" = "broadcastmessage" ]; then BROADCASTMESSAGE=`echo $BROADCASTMESSAGE | sed "s|<|\<|g"` - echo "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:"$BROADCASTMESSAGE"\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:"$BROADCASTMESSAGE"\" STIME=`date +%s`" REQUEST= fi -if [ ! "$PACKAGE" -a "$MAINTAINERMODE" != "true" ]; then +if [ "$MAINTAINERMODE" != "true" -a ! "$PACKAGE" ]; then echo " " echo " " echo " " @@ -546,6 +687,9 @@ if [ "$REPOSITORY" != "" -a "$MAINTAINERMODE" = "true" ]; then echo -n "
Log:
"
       cat $local_ftp/$REPOSITORY/distromatic.log
       echo -n "
" + echo -n "" echo -n "]]>" fi fi @@ -557,7 +701,7 @@ if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" ]; then fi if [ "$MAINTAINERMODE" != "true" -a "$SPECAVAILABLE" ]; then if [ "$REQUEST" = "edit" ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"is working on $PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"is working on $PACKAGE\" STIME=`date +%s`" fi echo -n "$PACKAGE.spec in build environment: " echo -n "new version (empty=autodetect):" @@ -588,8 +732,100 @@ if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" ]; then if [ "$MAINTAINERMODE" = "true" -o "$SPECAVAILABLE" ]; then echo -n "" if [ "$MAINTAINERMODE" != "true" ]; then - if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then - echo -n "Last logs: " + echo -n "Package: $PACKAGE" + echo -n "
Target arch:" + echo -n "" + [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "
Autodist automatic builds:
" + if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + echo -n "Patch:" + echo -n "" + echo -n "" + echo -n "" + # autodist schedule + echo -n "
Schedule:" + # autodist unschedule + echo -n "" + # autodist skip + echo -n "" + fi + if [ "$STATE_ADVANCEDCONTROLS" ]; then + # autodist list-jobs + echo -n "Job:" + # autodist prepare + echo -n "
" + # autodist update + echo -n "" + # autodist build + echo -n "" + # autodist install + [ ! "$USER_CANINSTALL" ] && DISABLED="disabled=disabled" || DISABLED= + echo -n "" + # autodist send + [ ! "$USER_ALLREPOSITORIES" ] && DISABLED="disabled=disabled" || DISABLED= + echo -n "" + # autodist force checkbox + fi + if [ "$STATE_ADVANCEDCONTROLS" -o "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then + # autodist logs + echo -n "
Last autodist logs: " echo -n "OK " echo -n "FAILED
" echo -n "" echo -n "" - if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then - echo -n "
Scheduled builds:
" - echo -n "" - echo -n "" - echo -n "" - fi - echo -n "
" + echo -n "" fi - echo -n "Package: $PACKAGE
" - echo -n "RPM packaging commands:
" + echo -n "
RPM packaging commands:
" # check for updates echo -n "" @@ -652,16 +879,6 @@ if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" ]; then echo -n "" - echo -n "
target arch:" - echo -n "" echo -n "
Add patches:" echo -n "Repository maintenance:
" echo -n "Package: $PACKAGE
" - echo -n "Source: $REPOSITORY
" + echo -n "Origin: $REPOSITORY
" echo -n "Destination: " echo -n "" - echo -n "" +# echo -n "
" +# echo -n "" else # repository compare echo -n "" fi - echo -n "
simulate" + echo -n "simulate" fi if [ "$MAINTAINERMODE" != "true" ]; then if [ ! "${AUTOPORT_DISABLE[$ENVIRONMENT]}" -a ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then @@ -783,24 +1000,6 @@ if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" ]; then echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autoportlog\");>" fi - if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then - echo -n "
Autodist:
" - echo -n "Patch:" - echo -n "" - echo -n "" - echo -n "" - fi - echo -n "
Info:
" echo -n "" @@ -865,7 +1064,7 @@ else echo -n "$PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"removed the autodist patch for $PACKAGE\" STIME=`date +%s`" fi ;; "updatepatch") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE update" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist update patch for $PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist update patch for $PACKAGE\" STIME=`date +%s`" fi ;; "buildpatch") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist-tool makepatch $PACKAGE build" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist build patch for $PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist build patch for $PACKAGE\" STIME=`date +%s`" fi ;; "showscheduled") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist-tool schedule"; RET=$? ;; "unschedule") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist-tool unschedule $PACKAGE" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"unscheduled autodist job $PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"unscheduled autodist job $PACKAGE\" STIME=`date +%s`" fi ;; "skip") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist-tool skip $PACKAGE" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"added autodist job $PACKAGE to skipped list\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"added autodist job $PACKAGE to skipped list\" STIME=`date +%s`" fi ;; + "autodistprepare") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist -p $AUTODISTJOB --arch $AUTODISTARCH $AUTODISTADD" + RET=$? ;; + "autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist -u $AUTODISTJOB --arch $AUTODISTARCH $AUTODISTADD" + RET=$? ;; + "autodistbuild") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist -b $AUTODISTJOB --arch $AUTODISTARCH $AUTODISTADD" + RET=$? ;; + "autodistinstall") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist -i $AUTODISTJOB --arch $AUTODISTARCH $AUTODISTADD" + RET=$? ;; + "autodistsend") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autodist -s $AUTODISTJOB --arch $AUTODISTARCH $AUTODISTADD" + RET=$? ;; "buildrootfiles") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "cd @RPMBUILDROOT@ && find @BUILDROOT@"; RET=$? ;; "autospecupdatescheck") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a2"; RET=$? ;; "rpmprepare") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "rpmbuild -bp $PACKAGE.spec"; RET=$? ;; @@ -911,7 +1125,7 @@ else $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a5 $RPMFORCEADD $RPMARCHADD" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"successfully built $PACKAGE\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"successfully built $PACKAGE\" STIME=`date +%s`" fi sed -i "|RPMBUILD=$PACKAGE USER=$USER ENVIRONMENT=$ENVIRONMENT|d" $STATEDIR/buildingnow_log #kill `pstree -p 25541 | sed 's/(/\n(/g' | grep '(' | sed 's/(\(.*\)).*/\1/' | tr "\n" " "` @@ -935,7 +1149,7 @@ else RET=1 fi ;; "addpatch") if [ "$ADDPATCHURL" -a "$ADDPATCHNAME" ]; then - $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "curl \"$ADDPATCHURL\" -o ../SOURCES/$PACKAGE-$ADDPATCHNAME.patch" + $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "curl -s \"$ADDPATCHURL\" -o ../SOURCES/$PACKAGE-$ADDPATCHNAME.patch" RET=$? [ $RET -eq 0 ] && echo "Patch added with name $PACKAGE-$ADDPATCHNAME.patch" else @@ -945,7 +1159,7 @@ else "sendpackage") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autospec -u $PACKAGE -a10 --server $SENDREPOSITORY" RET=$? if [ $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent $PACKAGE to $SENDREPOSITORY\" STIME=`date +%s`" >> $STATEDIR/social_log + 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 @@ -960,7 +1174,7 @@ else $SUDO_WRAPPER local $PACKAGE "openmamba-repository import $SENDREPOSITORY $PACKAGE -d $REPOSITORYIMPORTTO $SIMULATEADD -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"imported $PACKAGE from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"imported $PACKAGE from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" fi ;; "repositoryrelease") @@ -968,7 +1182,7 @@ else $SUDO_WRAPPER local $PACKAGE "openmamba-repository release $SENDREPOSITORY $PACKAGE -d $REPOSITORYIMPORTTO $SIMULATEADD -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"released $PACKAGE from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"released $PACKAGE from $SENDREPOSITORY to $REPOSITORYIMPORTTO\" STIME=`date +%s`" fi ;; "repositorydiff") @@ -980,7 +1194,7 @@ else $SUDO_WRAPPER local $PACKAGE "openmamba-repository archive $SENDREPOSITORY $PACKAGE -y" RET=$? if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then - echo "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"archived $PACKAGE in $SENDREPOSITORY\" STIME=`date +%s`" >> $STATEDIR/social_log + social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"archived $PACKAGE in $SENDREPOSITORY\" STIME=`date +%s`" fi ;; "autoportnp") $SUDO_WRAPPER $ENVIRONMENT $PACKAGE "autoport -np $PACKAGE"; RET=$? ;;