diff options
author | Mike Jones <mjjones@us.ibm.com> | 2012-05-21 12:58:16 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-05-24 09:58:41 -0500 |
commit | 5e0ff967b230bb2de22a7ea855931586f60bcf89 (patch) | |
tree | e723999afcb6943ac49205317f8797d99eac9a86 | |
parent | 8f79484e208c90f4b52d452378550277b09c0599 (diff) | |
download | talos-hostboot-5e0ff967b230bb2de22a7ea855931586f60bcf89.tar.gz talos-hostboot-5e0ff967b230bb2de22a7ea855931586f60bcf89.zip |
HWPF: Detect duplicate IDs and hashes across all XML files
The previous versions of the attribute and error XML parser files only
looked for ID and hash collisions within a particular XML file. The code
is supposed to look for collisions across all XML files. Also ignore
newlines and leading/trailing whitespace when parsing attribute enums.
Change-Id: I1f88302f20c684dbee96b076df4119689d548cc3
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1089
Tested-by: Jenkins Server
Reviewed-by: Van H. Lee <vanlee@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseAttributeInfo.pl | 14 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl index f1783e8a8..29fad38c2 100755 --- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl @@ -56,6 +56,9 @@ # mjjones 04/10/12 Process Chip EC Feature attributes # mjjones 05/15/12 Detect duplicate attr ids and append # ULL after 64bit enumerator +# mjjones 05/21/12 Detect duplicate ids/hashes across files +# mjjones 05/21/12 Ignore newlines and whitespace when +# parsing enumerations # # End Change Log ****************************************************** @@ -187,14 +190,15 @@ print ASFILE "<h4>HWPF Attributes supported by this build.</h4>\n"; print ASFILE "<table border=\"4\">\n"; print ASFILE "<tr><th>Attribute ID</th><th>Attribute Description</th></tr>"; +my %enumHash; +my %attrIdHash; + #------------------------------------------------------------------------------ # For each XML file #------------------------------------------------------------------------------ foreach my $argnum (1 .. $#ARGV) { my $infile = $ARGV[$argnum]; - my %enumHash; - my %attrIdHash; # read XML file. The ForceArray option ensures that there is an array of # elements even if there is only one such element in the file @@ -383,8 +387,10 @@ foreach my $argnum (1 .. $#ARGV) foreach my $val (@vals) { - # Remove leading spaces - $val =~ s/^\s+//; + # Remove newlines and leading/trailing whitespace + $val =~ s/\n//; + $val =~ s/^\s+//; + $val =~ s/\s+$//; print AIFILE " ENUM_$attr->{id}_${val}"; if ($attr->{valueType} eq 'uint64') diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index 02f3354b1..a54883164 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -47,6 +47,7 @@ # mjjones 02/10/12 Allow err file with one element # mjjones 03/22/12 Generate hash values for enums # mjjones 05/15/12 Detect duplicate error rcs +# mjjones 05/21/12 Detect duplicate ids/hashes across files # # End Change Log ****************************************************** @@ -169,6 +170,9 @@ my $callout = 'callout'; my $deconfigure = 'deconfigure'; my $gard = 'gard'; +my %enumHash; +my %errorRcHash; + #------------------------------------------------------------------------------ # For each XML file #------------------------------------------------------------------------------ @@ -176,8 +180,6 @@ foreach my $argnum (1 .. $#ARGV) { my $infile = $ARGV[$argnum]; my $count = 0; - my %enumHash; - my %errorRcHash; #-------------------------------------------------------------------------- # Read XML file. The ForceArray option ensures that there is an array of |