diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-06-25 12:29:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-06-27 13:21:45 -0500 |
commit | 8778f4620fb440a968db84ad054fffe61b26d3ba (patch) | |
tree | fc7345a0f31dc013a4eff8267e9609ce63bfda4d /src/build/hwpf | |
parent | 200cabc160d825b9097f234f25270b398c5339b6 (diff) | |
download | talos-hostboot-8778f4620fb440a968db84ad054fffe61b26d3ba.tar.gz talos-hostboot-8778f4620fb440a968db84ad054fffe61b26d3ba.zip |
prcd_server incorrectly flags file as non-unique
. correct logic in file-matching section so that files that match
the last part of the filename aren't incorrectly flagged as an
error as being non-unique;
. add undocumented -k (keepsandbox) support to aid in debugging
Change-Id: Ie289ae9cdeb74c8c1cde98aa5c7150627f0866c7
RTC: 43996
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1243
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')
-rwxr-xr-x | src/build/hwpf/prcd_compile.tcl | 11 | ||||
-rwxr-xr-x | src/build/hwpf/prcd_server.tcl | 19 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/build/hwpf/prcd_compile.tcl b/src/build/hwpf/prcd_compile.tcl index 46e631f49..c36ce64c2 100755 --- a/src/build/hwpf/prcd_compile.tcl +++ b/src/build/hwpf/prcd_compile.tcl @@ -6,7 +6,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011-2012 # # p1 # @@ -20,7 +20,7 @@ # # Origin: 30 # -# IBM_PROLOG_END +# IBM_PROLOG_END_TAG # The next line is executed by /bin/sh, but not tcl \ exec tclsh "$0" "$@" @@ -285,6 +285,7 @@ foreach arg $argv { -v { set verbose 1 } -o { set state outputflag } -n { set newfiles 1 } + -k { set keepsandbox 1 } -*h* { puts {prcd_compile.tcl [--help] [-d <drivername>] [-o <ouput dir> ] [-n] <filename> } puts {} puts {Note this tool only supports *.{c,C,h,H,initfile,xml} files in the following hostboot directory trees: } @@ -402,8 +403,12 @@ if { ![info exists output_dir] } { eval {exec} "mkdir -p $output_dir" lappend cmds ":INFO userid $userid version $version" -lappend cmds ":DRIVER $driver" +if {[info exists keepsandbox]} { + lappend cmds ":INFO keepsandbox" +} + +lappend cmds ":DRIVER $driver" if {[info exists newfiles]} { diff --git a/src/build/hwpf/prcd_server.tcl b/src/build/hwpf/prcd_server.tcl index b5ead5d97..e717474f9 100755 --- a/src/build/hwpf/prcd_server.tcl +++ b/src/build/hwpf/prcd_server.tcl @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011-2012 # # p1 # @@ -19,7 +19,7 @@ # # Origin: 30 # -# IBM_PROLOG_END +# IBM_PROLOG_END_TAG # the next line restarts using tclsh\ exec tclsh "$0" "$@" @@ -64,6 +64,7 @@ proc AquireData { sock } { global log global running global driver + global keepsandbox if { [eof $sock] || [catch {gets $sock line}] } { puts "ERROR: Client closed unexpectedly" @@ -136,7 +137,7 @@ proc AquireData { sock } { # additionally, find usually outputs the file(s) separated by a newline. if there # is a filename that's not unique, we need to flag that as an erorr, so we use the # -printf to force them all onto 1 line. - set filen [ exec find $src_path $inc_path -type f -wholename *[ string trimleft $b "./" ] -printf "%p\t" ] + set filen [ exec find $src_path $inc_path -type f -wholename */[ string trimleft $b "./" ] -printf "%p\t" ] # and then truncate the last \t. yeah, hackish.. set filen [ string trimright $filen "\t" ] #puts $log "$sock: find found in sandbox: \"$filen\"" @@ -270,6 +271,11 @@ proc AquireData { sock } { } elseif {[regexp {:INFO +(.+)} $line a b] } { puts $sock ":DONE" puts $log "$sock: $b" + if {[regexp {keepsandbox} $b aa] } { + set keepsandbox 1 + } else { + set keepsandbox 0 + } flush $sock flush $log } else { @@ -303,6 +309,7 @@ proc CloseOut { sock } { global git_sh global backing global log + global keepsandbox if {![eof $sock]} { flush $sock } @@ -312,7 +319,10 @@ proc CloseOut { sock } { puts "[clock format [clock seconds]]: Close $socklist(addr,$sock)- " unset socklist(addr,$sock) if {[info exists git_sh($sock)] } { - # Comment out next line to avoid deleting the sandbox + if { $keepsandbox != 1 } { + # Comment out next line to avoid deleting the sandbox + eval {exec} "rm -rf $sb_dir/$sbname($sock)" + } eval {exec} "rm -rf $sb_dir/$sbname($sock)" unset git_sh($sock) #unset sandbox($sbname($sock)) @@ -636,6 +646,7 @@ set forever 1 set base_dir "/tmp" set logfile "$base_dir/prcd_server.log" set log {} +set keepsandbox 0 # Where are we running? foreach {host site c d} [split [exec hostname] .] break |