SVN: toys/stbr: . cvslog.sh requesters.txt stbr.tcl

shadzik shadzik at pld-linux.org
Sat May 12 22:06:51 CEST 2007


Author: shadzik
Date: Sat May 12 22:06:51 2007
New Revision: 8505

Added:
   toys/stbr/
   toys/stbr/cvslog.sh   (contents, props changed)
   toys/stbr/requesters.txt
   toys/stbr/stbr.tcl
Log:
- make it official, stbr scripts that are used on irc


Added: toys/stbr/cvslog.sh
==============================================================================
--- (empty file)
+++ toys/stbr/cvslog.sh	Sat May 12 22:06:51 2007
@@ -0,0 +1,26 @@
+#!/bin/bash
+# use with stbr.tcl
+# auth: shadzik at pld-linux.org
+
+CVSROOT=":pserver:cvs at cvs.pld-linux.org:/cvsroot"
+VALID=`cat ~/ApHeX/scripts/requesters.txt`
+HOST="pld-linux.org"
+FROM="$1"
+BRANCH="$2"
+
+while [ "$3" ]; do
+cvs -d $CVSROOT log SPECS/$3 |grep author |awk '{print $5}' |tr -d ';' |awk '{ if( !seen[$0] ) print; seen[$0] = 1 }' > temp.txt
+SEND_TO=`cat temp.txt |egrep "$VALID" |head -1`
+#echo "Sending request to $SEND_TO for $3 from $FROM"
+cat <<EOF |sendmail -t
+From: $FROM <$FROM at IRC-bot>
+To: $SEND_TO@$HOST
+Subject: build request
+
+$FROM is requesting build for $3 to $2
+EOF
+#echo $SEND_TO > sent.txt
+sleep 1
+shift
+done
+

Added: toys/stbr/requesters.txt
==============================================================================
--- (empty file)
+++ toys/stbr/requesters.txt	Sat May 12 22:06:51 2007
@@ -0,0 +1 @@
+shadzik|undefined|arekm|rotom|baggins|czarny|megabajt|radek|wiget|adamg|wolf|mmazur|wrobell

Added: toys/stbr/stbr.tcl
==============================================================================
--- (empty file)
+++ toys/stbr/stbr.tcl	Sat May 12 22:06:51 2007
@@ -0,0 +1,30 @@
+# Send To Builder Request TCL by shadzik at pld-linux.org
+
+set reqbook "./scripts/requesters.txt"
+set logfile "./scripts/stbr.log"
+set file "./scripts/cvslog.sh"
+set back &
+set cntr 0
+
+bind pub * !stbr pub:stbr
+bind pub * stbr: pub:stbr
+bind pub * stbr, pub:stbr
+
+proc pub:stbr {nick host hand chan arg} {
+global file key back cntr logfile
+putcmdlog "#$hand# Noticed Send To Build Request Mail command";
+if {$cntr<1} {incr cntr} {utimer 30 "set cntr 0"; putserv "privmsg $chan :$nick: I reached my STBR time limit (30sec). Please try later."; return 0}
+set first [lindex $arg 0]
+set second [lindex $arg 1]
+set specs ""; append specs $second; append specs " "; append specs [lrange $arg 2 end]
+set rspecs ""
+if {!([string match th-ready $first] || [string match th-test $first])} {putserv "privmsg $chan :$nick: Usage: !stbr th-{ready|test} spec1 spec2 ..."; return 0}
+if {([string length $second]<=2)} {putserv "privmsg $chan :$nick: Usage: !stbr th-{ready|test} spec1 spec2 ..."; return 0}
+foreach spec $specs {
+if {!([string match *.spec $spec])} { append spec ".spec"}
+lappend rspecs $spec
+}
+if {[exec $file $nick $first $rspecs $back]==0} {putserv "privmsg $chan :$nick: Blad, STBR nie zostal wyslany"; return 1}
+putserv "privmsg $chan :$nick: Sent STBR Mail to $first for $rspecs."; return 1}
+
+putlog "Send To Builder Request TCL v0.1 by shadzik loaded."


More information about the pld-cvs-commit mailing list