diff options
author | Mike Jones <mjjones@us.ibm.com> | 2011-12-12 11:37:11 -0600 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-12-16 15:11:09 -0600 |
commit | 135ab4104b8f07d7d854beee436e2549a35e2a84 (patch) | |
tree | a065b9ce892e3b5aa33ae76fd0a4466d5e94bdd3 | |
parent | ae7ae33719580137181c8072e02bca257dcbd744 (diff) | |
download | talos-hostboot-135ab4104b8f07d7d854beee436e2549a35e2a84.tar.gz talos-hostboot-135ab4104b8f07d7d854beee436e2549a35e2a84.zip |
HWPF: Add option to support read of all attrs for initfiles (for Cronus)
Change-Id: Ic2d2288dbf5133b29ccfb295164a17791d3b344f
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/577
Tested-by: Jenkins Server
Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
-rwxr-xr-x | src/usr/hwpf/fapi/fapiCreateIfAttrService.pl | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl index ab71d80e0..56076c4f9 100755 --- a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl +++ b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl @@ -33,6 +33,8 @@ # Flag Track# Userid Date Description # ---- -------- -------- -------- ----------- # mjjones 11/15/11 Copied from fapiParseAttributeInfo +# mjjones 12/12/11 Support all attributes if no if-attr +# files specified (for Cronus) # # End Change Log ****************************************************** @@ -42,14 +44,18 @@ use strict; # Print Command Line Help #------------------------------------------------------------------------------ my $numArgs = $#ARGV + 1; -if ($numArgs < 4) +if ($numArgs < 3) { print ("Usage: fapiCreateIfAttrService.pl <output dir>\n"); - print (" <if-attr-file1> [<if-attr-file2> ...]\n"); + print (" [<if-attr-file1> <if-attr-file2> ...]\n"); print (" -a <attr-xml-file1> [<attr-xml-file2> ...]\n"); - print (" This perl script will parse initfile attr files and attribute XML\n"); - print (" files and create the fapiGetInitFileAttr() function in a file\n"); - print (" called fapiAttributeService.C\n"); + print (" This perl script will parse if-attr files (containing the\n"); + print (" attributes used by the initfile) and attribute XML files\n"); + print (" (containing all HWPF attributes) and create the\n"); + print (" fapiGetInitFileAttr() function in a file called\n"); + print (" fapiAttributeService.C. Only the attributes specified in\n"); + print (" the if-attr files are supported. If no if-attr files are\n"); + print (" specified then all attributes are supported\n"); exit(1); } @@ -90,6 +96,7 @@ print ASFILE " ReturnCode l_rc;\n\n"; my $xmlFiles = 0; my $attCount = 0; +my $numIfAttrFiles = 0; my @attrIds; #------------------------------------------------------------------------------ @@ -112,6 +119,7 @@ foreach my $argnum (1 .. $#ARGV) # Process initfile attr file. This file contains the HWPF attributes # that the initfile uses. #---------------------------------------------------------------------- + $numIfAttrFiles++; open(ATTRFILE, "<", $infile); # Read each line of the file (each line contains an attribute) @@ -162,18 +170,26 @@ foreach my $argnum (1 .. $#ARGV) } #------------------------------------------------------------------ - # Find if the attribute is used by any initfile + # Find if the attribute is used by any initfile. If no if-attr + # files were specified then support all attributes #------------------------------------------------------------------ my $match = 0; - foreach my $attrId (@attrIds) + if ($numIfAttrFiles) { - if ($attr->{id} eq $attrId) + foreach my $attrId (@attrIds) { - $match = 1; - last; + if ($attr->{id} eq $attrId) + { + $match = 1; + last; + } } } + else + { + $match = 1; + } if (!($match)) { |