Commit 3345fccc 3345fccc9e827f05ab68626e351a39bcf525a172 by Sergey Poznyakoff

Couple of fixes.

1 parent 0325bb6e
...@@ -185,7 +185,7 @@ proc mu_exec {args} { ...@@ -185,7 +185,7 @@ proc mu_exec {args} {
185 } 185 }
186 186
187 # Pity, dejagnu provides no way to retrieve exit status of the process. 187 # Pity, dejagnu provides no way to retrieve exit status of the process.
188 # This ugli construction is used to work around this. Hopefully, it 188 # This ugly construction is used to work around this. Hopefully, it
189 # should execute on any decent platform... 189 # should execute on any decent platform...
190 set cmd "sh -c \"$MU_TOOL $sw\; echo \$?\"" 190 set cmd "sh -c \"$MU_TOOL $sw\; echo \$?\""
191 verbose "Executing $cmd" 191 verbose "Executing $cmd"
...@@ -301,10 +301,6 @@ proc mu_version {} { ...@@ -301,10 +301,6 @@ proc mu_version {} {
301 return 301 return
302 } 302 }
303 303
304 if {![info exists MU_CAPABILITY]} {
305 return
306 }
307
308 set output [remote_exec host "$MU_TOOL --show-config-options"] 304 set output [remote_exec host "$MU_TOOL --show-config-options"]
309 set flg [split [lindex $output 1]] 305 set flg [split [lindex $output 1]]
310 for {set i 0} {$i < [llength $flg]} {incr i} { 306 for {set i 0} {$i < [llength $flg]} {incr i} {
...@@ -314,14 +310,18 @@ proc mu_version {} { ...@@ -314,14 +310,18 @@ proc mu_version {} {
314 set MU_CAPABILITY([lindex $flg $i]) 1 310 set MU_CAPABILITY([lindex $flg $i]) 1
315 } 311 }
316 } 312 }
317 set MU_TOOL_VERSION $MU_CAPABILITY(VERSION) 313 if [info exists MU_CAPABILITY(VERSION)] {
314 set MU_TOOL_VERSION $MU_CAPABILITY(VERSION)
315 } else {
316 set MU_TOOL_VERSION "UNKNOWN"
317 }
318 } 318 }
319 319
320 proc mu_check_capability {args} { 320 proc mu_check_capability {args} {
321 global MU_CAPABILITY 321 global MU_CAPABILITY
322 322
323 set name [lindex $args 0] 323 set name [lindex $args 0]
324 if ![info exists MU_CAPABILITY($name)] { 324 if {![info exists MU_CAPABILITY] || ![info exists MU_CAPABILITY($name)]} {
325 return 0 325 return 0
326 } else { 326 } else {
327 return $MU_CAPABILITY($name) 327 return $MU_CAPABILITY($name)
......