From 298ad4d73c391497bb66f7d8ed08c62e23c973d7 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 10 Sep 2012 17:41:15 +0200 Subject: [PATCH] autodist,autoport: support for sending status to webbuild social log --- autodist | 22 ++++++++++++++++++++++ autoport | 27 +++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/autodist b/autodist index e317f38..6c95802 100755 --- a/autodist +++ b/autodist @@ -245,6 +245,24 @@ esac # exit 1 #} +# for webbuild message +function cgi_encodevar() { + local string="${1}" + local strlen=${#string} + local encoded="" + + for (( pos=0 ; pos$pkg to $SEND_SERVER\"`" >/dev/null + fi ;; esac fi diff --git a/autoport b/autoport index b6e33f0..74015fd 100755 --- a/autoport +++ b/autoport @@ -43,6 +43,25 @@ ${me[0]} ${me[1]} } + +# for webbuild message +function cgi_encodevar() { + local string="${1}" + local strlen=${#string} + local encoded="" + + for (( pos=0 ; pos $logfile - ln -sf $logdate.log $DATAARCHDIR/current.log + ln -sf $logdate.log $DATAARCHDIR/$PORT_REPOSITORY-current.log BUILD_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_build}` BUILD_CPU=`echo $BUILD_PLATFORM | cut -d- -f1` @@ -495,6 +514,10 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do JOB_SENT=(${JOB_SENT[*]} $JOB_CURRENT) echo $JOB_CURRENT >> $DATAARCHDIR/sentjobs echo -n "(OK) " + if [ "$BATCH_MODE" -a "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then + curl -s "$WEBBUILD_URL?REQUEST=message&USER=$WEBBUILD_USER&SECRET=$WEBBUILD_SECRET&USER_EMAIL=$WEBBUILD_EMAIL&\ +MESSAGE=`cgi_encodevar \"ported $JOB_CURRENT to $TARGET_ARCH and sent it to $pkg_repository\"`" >/dev/null + fi } echo -n "install" LANG=C LC_ALL=C autodist -i ${JOB_CURRENT} --arch $TARGET_ARCH --force --severity 2 -- $STAGEOPTS &>$tmpfile