SVN: toys/stbr/stbr.tcl

shadzik shadzik at pld-linux.org
Wed Oct 7 18:42:49 CEST 2009


Author: shadzik
Date: Wed Oct  7 18:42:49 2009
New Revision: 10714

Modified:
   toys/stbr/stbr.tcl
Log:
- fixed bugfix where spec with '-' in name was treated as a --without bcond
- changed usage a bit to simplify cases


Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl	(original)
+++ toys/stbr/stbr.tcl	Wed Oct  7 18:42:49 2009
@@ -10,7 +10,7 @@
 set back &
 set cntr 0
 set cvsroot ":pserver:cvs at cvs.pld-linux.org:/cvsroot"
-set usage "Usage: !stbr \[help\] \[url\] \[version\] th\|ti \[no\]upgrade spec1\[:BRANCH\]\[+bcond+...\]\[-bcond-...\]\[%kernel%...\] spec2\[:BRANCH\]\[+bcond+...\]\[-bcond-...\]\[%kernel%...\] ..."
+set usage "Usage: !stbr \[help\] \[url\] \[version\] th\|ti \[no\]upgrade spec1\[:BRANCH\]\[/\[+bcond+...\]\[-bcond-...\]\[%kernel%...\]\] spec2\[:BRANCH\]\[/\[+bcond+...\]\[-bcond-...\]\[%kernel%...\]\] ..."
 set nickpass "stbr-bot"
 set cmdtxt "./scripts/cmd.txt"
 set maintenance "./scripts/maintenance.txt"
@@ -201,81 +201,56 @@
 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 noupgrade $second])} {set second "test-build"}
 foreach spec $specs {
-if {([string match *:* $spec])} {
-	set splited [split $spec ":"]
-	set spec [lindex $splited 0] 
-	set branchstr [lindex $splited 1]
-	if {([string match *+* $branchstr]) || ([string match *-* $branchstr]) || ([string match *%* $branchstr])} {
-		if {([string match *%* $branchstr])} {
-			set bsplited [split $branchstr "%"]
-			set branchstr [lindex $bsplited 0]
-			set defines [lrange $bsplited 1 end]
-			if {([string match *-* $branchstr])} {
-				set bsplited [split $branchstr "-"]
-				set branchstr [lindex $bsplited 0]
-				set bconds_without [lrange $bsplited 1 end]
-				if {([string match *+* $branchstr])} {
-					set bsplited [split $branchstr "+"]
-					set branch [lindex $bsplited 0]
-					set bconds_with [lrange $bsplited 1 end]
-				} else {
-					set branch $branchstr
-				}
-			} elseif {([string match *+* $branchstr])} {
-				set bsplited [split $branchstr "+"]
-				set branch [lindex $bslited 0]
-				set bconds_with [lrange $bsplited 1 end]
-			}
-		} elseif {([string match *-* $branchstr])} {
-			set bsplited [split $branchstr "-"]
-			set branchstr [lindex $bsplited 0]
-			set bconds_without [lrange $bsplited 1 end]
-			if {([string match *+* $branchstr])} {
-				set bsplited [split $branchstr "+"]
-				set branch [lindex $bsplited 0]
-				set bconds_with [lrange $bsplited 1 end]
-			}
-		}
+if {([string match */* $spec])} {
+	set halfs [split $spec "/"]
+	set spechalf [lindex $halfs 0]
+	set bcondshalf [lindex $halfs 1]
+	if {([string match *:* $spechalf])} {
+		set halfs [split $spechalf ":"]
+		set spec [lindex $halfs 0]
+		set branch [lindex $halfs 1]
 	} else {
-		set branch $branchstr
+		set spec $spechalf
+		set branch "HEAD"
 	}
-} else {
-	set branch "HEAD"
-	if {([string match *+* $spec]) || ([string match *-* $spec]) || ([string match *%* $spec])} {
-		if {([string match *%* $spec])} {
-			set bsplited [split $spec "%"]
-			set spec [lindex $bsplited 0]
+	if {([string match *+* $bcondhalf]) || ([string match *-* $bcondhalf]) || ([string match *%* $bcondhalf])} {
+		if {([string match *%* $bcondhalf])} {
+			set bsplited [split $bcondhalf "%"]
+			set bcondhalf [lindex $bsplited 0]
 			set defines [lrange $bsplited 1 end]
-			if {([string match *-* $spec])} {
-				set bsplited [split $spec "-"]
-				set spec [lindex $bsplited 0]
+			if {([string match *-* $bcondhalf])} {
+				set bsplited [split $bcondhalf "-"]
+				set bcondhalf [lindex $bsplited 0]
 				set bconds_without [lrange $bsplited 1 end]
-				if {([string match *+* $spec])} {
-					set bsplited [split $spec "+"]
-					set spec [lindex $bsplited 0]
-					set bconds_with [lrange $bsplited 1 end]
-				} else {
-					set spec $spec
+				if {([string match *+* $bcondhalf])} {
+					set bsplited [split $bcondhalf "+"]
+					set bconds_with [lrange $bsplited 0 end]
 				}
-			} elseif {([string match *+* $spec])} {
-				set bsplited [split $spec "+"]
-				set spec [lindex $bslited 0]
-				set bconds_with [lrange $bsplited 1 end]
+			} elseif {([string match *+* $bcondhalf])} {
+				set bsplited [split $bcondhalf "+"]
+				set bconds_with [lrange $bsplited 0 end]
 			}
-		} elseif {([string match *-* $spec])} {
-			set bsplited [split $spec "-"]
-			set spec [lindex $bsplited 0]
+		} elseif {([string match *-* $bcondhalf])} {
+			set bsplited [split $bcondhalf "-"]
+			set bcondhalf [lindex $bsplited 0]
 			set bconds_without [lrange $bsplited 1 end]
-			if {([string match *+* $spec])} {
-				set bsplited [split $spec "+"]
-				set spec [lindex $bsplited 0]
-				set bconds_with [lrange $bsplited 1 end]
+			if {([string match *+* $bcondhalf])} {
+				set bsplited [split $bcondhalf "+"]
+				set bconds_with [lrange $bsplited 0 end]
 			}
+		} else {
+			set bsplited [split $bcondhalf "+"]
+			set bconds_with [lrange $bsplited 0 end]
 		}
-	} else {
-		set spec $spec
 	}
+} elseif {([string match *:* $spec])} {
+	set splited [split $spec ":"]
+	set spec [lindex $splited 0]
+	set branch [lindex $splited 1]
+} else {
+	set branch "HEAD"
 }
+
 if {$bconds_with != ""} {
 	set flag "--with "
 	set with ""


More information about the pld-cvs-commit mailing list