SVN: toys/stbr/stbr.tcl

shadzik shadzik at pld-linux.org
Sat Sep 15 00:21:28 CEST 2007


Author: shadzik
Date: Sat Sep 15 00:21:27 2007
New Revision: 8723

Modified:
   toys/stbr/stbr.tcl
Log:
- don't send mails to developers when requesting a test-build, instead send the request directly to builder (we now have the rights to it)


Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl	(original)
+++ toys/stbr/stbr.tcl	Sat Sep 15 00:21:27 2007
@@ -3,6 +3,7 @@
 set reqbook "./scripts/requesters.txt"
 set logfile "/home/users/stbr/db/stbrlog.db"
 set file "./scripts/cvslog.sh"
+set makereq "./pld-builder.new/client/make-request.sh"
 set back &
 set cntr 0
 set cvsroot ":pserver:cvs at cvs.pld-linux.org:/cvsroot"
@@ -46,7 +47,7 @@
 bind pub * stbr, pub:stbr
 
 proc pub:stbr {nick host hand chan arg} {
-global file back cntr logfile usage
+global file back cntr logfile usage makereq
 putcmdlog "#$hand# Noticed Send To Build Request Mail command";
 set first [lindex $arg 0]
 if {([string match help $first])} {help $nick; return 0}
@@ -54,6 +55,7 @@
 set second [lindex $arg 1]
 set specs ""; append specs $second; append specs " "; append specs [lrange $arg 2 end]
 set rspecs ""
+set tspecs ""
 if {!([string match th-ready $first] || [string match th-test $first] || [string match noupgrade $first] || [string match upgrade $first])} {putserv "privmsg $chan :$nick: $usage"; return 0}
 if {([string length $second]<2)} {putserv "privmsg $chan :$nick: $usage"; return 0}
 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}
@@ -67,12 +69,22 @@
 set towho [sendto $spec $branch]
 if {($towho == 0)} {putserv "privmsg $chan :$nick: There is no such spec ($spec) on branch $branch in PLD's repository."; return 0}
 lappend rspecs $spec; append rspecs ":$branch (to $towho)"
-if {[exec $file $nick $first $spec $branch $towho]==0} {putserv "privmsg $chan :$nick: An error occured. Couldn't send STBR Mail for $spec to $towho."; return 1}
-exec sqlite $logfile "INSERT INTO application VALUES('$date','$spec','$branch','$towho','$first');"
+lappend tspecs $spec; append tspecs ":$branch"
+if {([string match test-build $first])} {
+	if {[exec $makereq -t $spec:$branch]==0} {putserv "privmsg $chan :$nick: An error occured. Couldn't send test-build request for $spec to builders."; return 1}
+	exec sqlite $logfile "INSERT INTO application VALUES('$date','$spec','$branch','stbr','$first');"
+} {
+	if {[exec $file $nick $first $spec $branch $towho]==0} {putserv "privmsg $chan :$nick: An error occured. Couldn't send STBR Mail for $spec to $towho."; return 1}
+	exec sqlite $logfile "INSERT INTO application VALUES('$date','$spec','$branch','$towho','$first');"
+}
 }
 exec sqlite $logfile "INSERT INTO stbr VALUES('$date','$nick');"
-putserv "privmsg $chan :$nick: Sent STBR Mail for $rspecs. An $first will be performed."
+if {([string match test-build $first])} {
+	putserv "privmsg $chan :$nick: Sent $first request for $tspecs directly to builders."
+} {
+	putserv "privmsg $chan :$nick: Sent STBR Mail for $rspecs. An $first will be performed."
+}
 if {$cntr<1} {incr cntr} {utimer 30 "set cntr 0"; return 1}
 }
 
-putlog "Send To Builder Request TCL v0.5 by shadzik loaded."
+putlog "Send To Builder Request TCL v0.6 by shadzik loaded."


More information about the pld-cvs-commit mailing list