summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2017-05-25 22:21:17 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-06-01 09:24:17 -0400
commitf4424e7fdbdcd0c4eb6549e8013bec7993e2197e (patch)
treecfd055e17bab96926dc45585ffa17a5f6087c6ac /src/build
parent392272c0247878a832473157e7d2e6023496ca99 (diff)
downloadtalos-hostboot-f4424e7fdbdcd0c4eb6549e8013bec7993e2197e.tar.gz
talos-hostboot-f4424e7fdbdcd0c4eb6549e8013bec7993e2197e.zip
Add support for a wofdata directory
This commit changes the input function to support a directory that will contain all the wofdata csv files. This is set up to only support directory or files, not both. Change-Id: I82178d6a25b085aad2d999f33ee05cd5b659db7f RTC:172188 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41010 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-xsrc/build/buildpnor/wof-tables-img27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/build/buildpnor/wof-tables-img b/src/build/buildpnor/wof-tables-img
index 001dc3d4b..b7590c3ff 100755
--- a/src/build/buildpnor/wof-tables-img
+++ b/src/build/buildpnor/wof-tables-img
@@ -2751,7 +2751,7 @@ sub print_usage
print STDERR
"Usage:\n" .
- " wof-tables-img --create <image_file> <csv_file> [<csv_file> ...]\n" .
+ " wof-tables-img --create <image_file> <csv_file>/<csv_dir> [<csv_file> ...]\n" .
" wof-tables-img --list <image_file>\n" .
" wof-tables-img --view <image_file> --core_count <number>\n" .
" --socket_power <number> --nest_freq <number>\n" .
@@ -2763,7 +2763,7 @@ sub print_usage
" --pdv_sort_power_target_freq <number> <output_file>\n" .
" wof-tables-img --help\n" .
"Actions:\n" .
- " --create Create a WOF Tables image file based on input CSV files.\n" .
+ " --create Create a WOF Tables image file based on input CSV files or directory.\n" .
" --list List the contents of a WOF Tables image file.\n" .
" --view View one VFRT within a WOF Tables image file.\n" .
" --extract Extract one set of WOF Tables from an image file.\n" .
@@ -2802,13 +2802,30 @@ sub _verify_create_options
}
}
- # Treat any remaining (unparsed) command line arguments as CSV files.
+ # Treat any remaining (unparsed) command line arguments as CSV files or
+ # CSV directory that contains the CSV files.
# Verify that at least one was specified.
if (scalar(@ARGV) == 0)
{
- die "Error: --create requires one or more CSV files.\n";
+ die "Error: --create requires one or more CSV files or one directory.\n";
+ }
+
+ foreach my $filename (@ARGV)
+ {
+ if(-f $filename)
+ {
+ # The CSV files were given as files, return original array
+ $self->{'csv_files'} = [ @ARGV ];
+ }
+ if(-d $filename)
+ {
+ # The CSV files were given in a directory, pull out each filename
+ my @file_list = glob("$filename/*");
+ @file_list = grep {-f $_} @file_list;
+
+ $self->{'csv_files'} = [ @file_list ];
+ }
}
- $self->{'csv_files'} = [ @ARGV ];
}
OpenPOWER on IntegriCloud