diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-04-04 09:47:56 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-09 12:38:01 -0500 |
commit | fb636daca653bfba4cc395e078cafe874f49efe0 (patch) | |
tree | fb3797fc1b2b9500cc2f3bcead7377271ac7f5ec /src/build/hwpf/prcd_server.tcl | |
parent | 5b536ece6c453b4662de8ec8e74ef2ff20a930ea (diff) | |
download | talos-hostboot-fb636daca653bfba4cc395e078cafe874f49efe0.tar.gz talos-hostboot-fb636daca653bfba4cc395e078cafe874f49efe0.zip |
fix prcd_server.tcl and prcd_compile.tcl to better detect/handle errors.
user reported an issue w/ the tool, where the build wasn't happening, but
the prcd_compile.tcl script reported no error. investigation showed that
the prcd_server.tcl script was not able to create the sandbox directory
in /tmp because the OS had removed the /tmp/hwp directory. fixes:
. server script will make the /tmp/hwp directory each extract time
. if server script has an error, the msg back to the compile script
will start ERROR:
. compile script will look for ERROR: messages and report them to the
user as a server script error and exit w/ an error code.
Change-Id: I90dee6d57e807fc274e0a44210412d7007c199b0
RTC: 39966
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/821
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/hwpf/prcd_server.tcl')
-rwxr-xr-x | src/build/hwpf/prcd_server.tcl | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/build/hwpf/prcd_server.tcl b/src/build/hwpf/prcd_server.tcl index 8f80515c7..c3249691a 100755 --- a/src/build/hwpf/prcd_server.tcl +++ b/src/build/hwpf/prcd_server.tcl @@ -66,7 +66,7 @@ proc AquireData { sock } { global driver if { [eof $sock] || [catch {gets $sock line}] } { - puts "Client closed unexpectedly" + puts "ERROR: Client closed unexpectedly" puts $log "$sock: Client closed unexpectedly" CloseOut $sock } else { @@ -96,19 +96,16 @@ proc AquireData { sock } { puts $log "$sock: $sbname($sock)" # Make sure sandbox dir exists - if {[file exists $sb_dir]} { - file mkdir "$sb_dir/$sbname($sock)" - + if {[catch {file mkdir "$sb_dir/$sbname($sock)"} res ] } { + puts $sock "ERROR: Could not extract code\n" + puts $log "$sock: Could not extract code\n)" + CloseOut $sock + } else { set git_sh($sock) [open "|bash" r+] fconfigure $git_sh($sock) -buffering none fileevent $git_sh($sock) readable [list IfResult $git_sh($sock) $sock $sbname($sock)] ExtractSandbox $sock $git_sh($sock) - - } else { - puts $sock "Could not extract code\n" - puts $log "$sock: Could not extract code\n)" - CloseOut $sock } } elseif {[regexp {:HWP_FILE +(.+) +(.+)} $line a b c] } { @@ -119,7 +116,7 @@ proc AquireData { sock } { flush $log if { ![info exists sbname($sock)] } { - puts $sock "No sandbox found" + puts $sock "ERROR: No sandbox found" puts $log "$sock: No sandbox found" CloseOut $sock return @@ -146,13 +143,13 @@ proc AquireData { sock } { # error if filen is not just 1 file set filesfound [regexp -all {[^\t]+} $filen ] if { $filesfound == 0 } { - puts $sock "error: Invalid Input File - $b - file not found in sandbox" + puts $sock "ERROR: Invalid Input File - $b - file not found in sandbox" puts $log "$sock: Invalid Input File - $b - file not found in sandbox" CloseOut $sock return } if { $filesfound > 1 } { - puts $sock "error: Invalid Input File - $b - filename NOT unique in sandbox" + puts $sock "ERROR: Invalid Input File - $b - filename NOT unique in sandbox" puts $log "$sock: Invalid Input File - $b - filename NOT unique in sandbox" CloseOut $sock return @@ -160,7 +157,7 @@ proc AquireData { sock } { # Open with create/overwrite option if {[catch {set hwpfile($sock) [open "$filen" w+] } res ] } { - puts $sock "Server can't open $filen" + puts $sock "ERROR: Server can't open $filen" puts $log "$sock: Server can't open $filen" CloseOut $sock } else { @@ -192,7 +189,7 @@ proc AquireData { sock } { flush $log if { ![info exists sbname($sock)] } { - puts $sock "No sandbox found" + puts $sock "ERROR: No sandbox found" puts $log "$sock: No sandbox found" CloseOut $sock return @@ -211,7 +208,7 @@ proc AquireData { sock } { #puts $log "$sock: writing filen: \"$filen\""; flush $log # Open with create/overwrite option if {[catch {set hwpfile($sock) [open "$filen" w+] } res ] } { - puts $sock "Server can't open $filen" + puts $sock "ERROR: Server can't open $filen" puts $log "$sock: Server can't open $filen" CloseOut $sock } else { @@ -591,7 +588,7 @@ proc SendObjFiles { sock obj_dir } { # Send the image files if {[catch {set hbi_files [glob -dir $obj_dir simics*.bin vbu*bin hbicore*.bin *.syms hbotStringFile]} res]} { puts $sock "ERROR: Needed image files not found in $obj_dir" - puts $log "$sock: ERROR: Needed image files not found in $obj_dir" + puts $log "$sock: Needed image files not found in $obj_dir" } else { SendFiles $sock $hbi_files } |