SVN: toys/stbr/stbr.tcl
adamg
adamg at pld-linux.org
Sat Dec 22 20:14:35 CET 2007
Author: adamg
Date: Sat Dec 22 20:14:34 2007
New Revision: 9153
Modified:
toys/stbr/stbr.tcl
Log:
- indentations
Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl (original)
+++ toys/stbr/stbr.tcl Sat Dec 22 20:14:34 2007
@@ -14,13 +14,13 @@
bind dcc n identify man_identify
proc man_identify { hand idx mask } {
-global nickpass
+ global nickpass
putserv "PRIVMSG NickServ :identify $nickpass"
putlog "Sending Identify to NickServ"
}
proc identify { nick uhost hand text } {
-global nickpass
+ global nickpass
putserv "PRIVMSG NickServ :identify $nickpass"
putlog "Sending Identify to NickServ"
}
@@ -55,16 +55,16 @@
}
proc sendto {spec branch} {
-global cvsroot reqbook
-if {([string match HEAD $branch])} {set cmd "-N"} {set cmd "-r$branch"}
-if {[catch {exec cvs -d $cvsroot log $cmd SPECS/$spec | awk {/author/{a = $5; sub(/;/, "", a); if (!seen[a]) print a; seen[a] = 1}}} results]} {return 0}
-set file [open $reqbook r]
-gets $file lista
-close $file
-foreach devil $results {
- foreach requester $lista {
- if {([string match $requester $devil])} {return $devil}
- }
+ global cvsroot reqbook
+ if {([string match HEAD $branch])} {set cmd "-N"} {set cmd "-r$branch"}
+ if {[catch {exec cvs -d $cvsroot log $cmd SPECS/$spec | awk {/author/{a = $5; sub(/;/, "", a); if (!seen[a]) print a; seen[a] = 1}}} results]} {return 0}
+ set file [open $reqbook r]
+ gets $file lista
+ close $file
+ foreach devil $results {
+ foreach requester $lista {
+ if {([string match $requester $devil])} {return $devil}
+}
}
random
}
@@ -74,32 +74,32 @@
bind pub * stbr, pub:stbr
proc pub:stbr {nick host hand chan arg} {
-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}
-if {([string match url $first])} {url $nick; return 0}
-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}
-if {([string match th-test $first] || [string match noupgrade $first])} {set first "test-build"}
-if {([string match th-ready $first])} {set first "upgrade"}
-set time [clock seconds]
-set date [clock format $time -format "%Y-%m-%d %H:%M:%S"]
-foreach spec $specs {
-if {([string match *:* $spec])} {set splited [split $spec ":"];set spec [lindex $splited 0]; set branch [lindex $splited 1]} {set branch "HEAD"}
-if {!([string match *.spec $spec])} { append spec ".spec"}
-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)"
-lappend tspecs $spec; append tspecs ":$branch"
-if {([string match test-build $first])} {
- if {[utimer 5 "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');"
+ 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}
+ if {([string match url $first])} {url $nick; return 0}
+ 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}
+ if {([string match th-test $first] || [string match noupgrade $first])} {set first "test-build"}
+ if {([string match th-ready $first])} {set first "upgrade"}
+ set time [clock seconds]
+ set date [clock format $time -format "%Y-%m-%d %H:%M:%S"]
+ foreach spec $specs {
+ if {([string match *:* $spec])} {set splited [split $spec ":"];set spec [lindex $splited 0]; set branch [lindex $splited 1]} {set branch "HEAD"}
+ if {!([string match *.spec $spec])} { append spec ".spec"}
+ 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)"
+ lappend tspecs $spec; append tspecs ":$branch"
+ if {([string match test-build $first])} {
+ if {[utimer 5 "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');"
More information about the pld-cvs-commit
mailing list