SVN: toys/stbr/stbr.tcl

shadzik shadzik at pld-linux.org
Sat Feb 21 17:25:26 CET 2009


Author: shadzik
Date: Sat Feb 21 17:25:24 2009
New Revision: 10136

Modified:
   toys/stbr/stbr.tcl
Log:
- add banned_spec function
- 0.8b


Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl	(original)
+++ toys/stbr/stbr.tcl	Sat Feb 21 17:25:24 2009
@@ -12,6 +12,7 @@
 set nickpass "stbr-bot"
 set cmdtxt "./scripts/cmd.txt"
 set maintenance "./scripts/maintenance.txt"
+set bannedspec "./scripts/bannedspec.txt"
 
 bind notc - "*This nickname is owned by someone else*" identify
 bind dcc n identify man_identify 
@@ -75,6 +76,20 @@
 random $reqbook
 }
 
+proc banned_spec {spec} {
+global bannedspec
+set file [open $bannedspec r]
+gets $file lista
+close $file
+foreach bspec $lista {
+	if {([string match $spec $bspec])} {
+		return true
+	} else {
+		return false
+	}
+}
+}
+
 proc command {exe} {
 if {[catch {exec which $exe} results]} {return 0}
 }
@@ -98,7 +113,7 @@
 		set date ""; append date $day; append date " "; append date $hour
 		set developer [exec sqlite $logfile "select recipient from application where spec='$spec' and date='$date';"]
 		set email ""; append email $developer; append email "@pld-linux.org"
-		putcmdlog "Deleting entry for: $spec on $date"
+		putcmdlog "Deleting entry for: $spec on $date. Sending mail to $developer"
 		exec sqlite $logfile "DELETE FROM application where spec='$spec' and date='$date';"
 		exec sqlite $logfile "DELETE FROM stbr where date='$date';"
 		exec $cancellation $spec $email $hand
@@ -145,6 +160,8 @@
 if {!([string match *.spec $spec])} { append spec ".spec"}
 set towho [sendto $dist $spec $branch]
 if {($towho == 0)} {putserv "privmsg $chan :$nick: There is no such spec ($spec) on branch $branch in PLD's repository."; return 0}
+set isbanned [banned_spec $spec]
+if {($isbanned == "true")} {putserv "privmsg $chan :$nick: $spec is banned from being STBRed."; return 0}
 lappend rspecs $spec; append rspecs ":$branch (to $towho)"
 lappend tspecs $spec; append tspecs ":$branch"
 if {([string match test-build $second])} {
@@ -168,4 +185,4 @@
 if {$cntr<1} {incr cntr} {utimer 30 "set cntr 0"; return 1}
 }
 
-putlog "Send To Builder Request TCL v0.8a by shadzik loaded."
+putlog "Send To Builder Request TCL v0.8b by shadzik loaded."


More information about the pld-cvs-commit mailing list