Author: shadzik
Date: Fri May 18 05:57:41 2007
New Revision: 8605

Modified:
   toys/stbr/stbr.tcl
Log:
- increase performance by calling cvs log just once for each spec


Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl  (original)
+++ toys/stbr/stbr.tcl  Fri May 18 05:57:41 2007
@@ -8,14 +8,6 @@
 set cvsroot ":pserver:[EMAIL PROTECTED]:/cvsroot"
 set usage "Usage: !stbr \[help\] \[no\]upgrade spec1\[:BRANCH\] 
spec2\[:BRANCH\] ..."
 
-proc cvs {spec branch} {
-       global cvsroot
-       if {[catch {exec cvs -d $cvsroot log -r$branch SPECS/$spec} results]} {
-               return 0
-       }
-return 1
-}
-
 proc help {chan nick} {
        putserv "privmsg $chan :$nick: Most important is that you understand 
what the difference between 'upgrade' and 'noupgrade' is. When you call 
'noupgrade' it's going to be just an test-build. When you call 'upgrade' the 
package is going to be upgraded on builders and ftp."
 }
@@ -67,8 +59,8 @@
 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"}
-if {([cvs $spec $branch] == 0)} {putserv "privmsg $chan :$nick: There is no 
such spec ($spec) on branch $branch in PLD's repository."; return 0}
 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');"
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to