From: Peter O. <obe...@us...> - 2012-07-19 13:12:38
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv17527/bin Modified Files: genhtml geninfo lcov Log Message: lcov: implement command line option --rc Users can now use command line option --rc to override configuration file directives. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** geninfo 18 Jul 2012 12:56:21 -0000 1.103 --- geninfo 19 Jul 2012 13:12:35 -0000 1.104 *************** *** 241,244 **** --- 241,245 ---- our $opt_gcov_all_blocks = 1; our $opt_compat; + our $opt_rc; our %compat_value; our $gcno_split_crc; *************** *** 265,269 **** # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file:s" => \$opt_config_file); Getopt::Long::Configure("default"); --- 266,271 ---- # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file=s" => \$opt_config_file, ! "rc=s%" => \$opt_rc); Getopt::Long::Configure("default"); *************** *** 280,286 **** } ! if ($config) { ! # Copy configuration file values to variables apply_config({ "geninfo_gcov_tool" => \$gcov_tool, --- 282,288 ---- } ! if ($config || $opt_rc) { ! # Copy configuration file and --rc values to variables apply_config({ "geninfo_gcov_tool" => \$gcov_tool, *************** *** 324,327 **** --- 326,331 ---- "no-external" => \$opt_no_external, "compat=s" => \$opt_compat, + "config-file=s" => \$opt_config_file, + "rc=s%" => \$opt_rc, )) { *************** *** 1967,1972 **** # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hash CONFIG contains a value for ! # keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # --- 1971,1976 ---- # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hashes CONFIG or OPT_RC contain a value ! # for keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # *************** *** 1977,1982 **** foreach (keys(%{$ref})) { ! if (defined($config->{$_})) ! { ${$ref->{$_}} = $config->{$_}; } --- 1981,1987 ---- foreach (keys(%{$ref})) { ! if (defined($opt_rc->{$_})) { ! ${$ref->{$_}} = $opt_rc->{$_}; ! } elsif (defined($config->{$_})) { ${$ref->{$_}} = $config->{$_}; } Index: genhtml =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genhtml,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** genhtml 18 Jul 2012 10:40:12 -0000 1.60 --- genhtml 19 Jul 2012 13:12:35 -0000 1.61 *************** *** 291,294 **** --- 291,295 ---- our @ignore; our $opt_config_file; # User-specified configuration file location + our $opt_rc; our $charset = "UTF-8"; # Default charset for HTML pages our @fileview_sortlist; *************** *** 321,325 **** # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file:s" => \$opt_config_file); Getopt::Long::Configure("default"); --- 322,327 ---- # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file=s" => \$opt_config_file, ! "rc=s%" => \$opt_rc); Getopt::Long::Configure("default"); *************** *** 336,342 **** } ! if ($config) { ! # Copy configuration file values to variables apply_config({ "genhtml_css_file" => \$css_filename, --- 338,344 ---- } ! if ($config || $opt_rc) { ! # Copy configuration file and --rc values to variables apply_config({ "genhtml_css_file" => \$css_filename, *************** *** 405,408 **** --- 407,412 ---- "demangle-cpp" => \$demangle_cpp, "ignore-errors=s" => \@opt_ignore_errors, + "config-file=s" => \$opt_config_file, + "rc=s%" => \$opt_rc, )) { *************** *** 5572,5577 **** # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hash CONFIG contains a value for ! # keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # --- 5576,5581 ---- # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hashes CONFIG or OPT_RC contain a value ! # for keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # *************** *** 5582,5587 **** foreach (keys(%{$ref})) { ! if (defined($config->{$_})) ! { ${$ref->{$_}} = $config->{$_}; } --- 5586,5592 ---- foreach (keys(%{$ref})) { ! if (defined($opt_rc->{$_})) { ! ${$ref->{$_}} = $opt_rc->{$_}; ! } elsif (defined($config->{$_})) { ${$ref->{$_}} = $config->{$_}; } Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** lcov 18 Jul 2012 10:40:12 -0000 1.85 --- lcov 19 Jul 2012 13:12:35 -0000 1.86 *************** *** 192,195 **** --- 192,196 ---- our $opt_no_external; our $opt_config_file; + our $opt_rc; our @opt_summary; our $opt_compat; *************** *** 222,226 **** # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file:s" => \$opt_config_file); Getopt::Long::Configure("default"); --- 223,228 ---- # Check command line for a configuration file name Getopt::Long::Configure("pass_through", "no_auto_abbrev"); ! GetOptions("config-file=s" => \$opt_config_file, ! "rc=s%" => \$opt_rc); Getopt::Long::Configure("default"); *************** *** 237,243 **** } ! if ($config) { ! # Copy configuration file values to variables apply_config({ "lcov_gcov_dir" => \$gcov_dir, --- 239,245 ---- } ! if ($config || $opt_rc) { ! # Copy configuration file and --rc values to variables apply_config({ "lcov_gcov_dir" => \$gcov_dir, *************** *** 288,291 **** --- 290,295 ---- "summary=s" => \@opt_summary, "compat=s" => \$opt_compat, + "config-file=s" => \$opt_config_file, + "rc=s%" => \$opt_rc, )) { *************** *** 4069,4074 **** # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hash CONFIG contains a value for ! # keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # --- 4073,4078 ---- # # where KEY_STRING is a keyword and VAR_REF is a reference to an associated ! # variable. If the global configuration hashes CONFIG or OPT_RC contain a value ! # for keyword KEY_STRING, VAR_REF will be assigned the value for that keyword. # *************** *** 4079,4084 **** foreach (keys(%{$ref})) { ! if (defined($config->{$_})) ! { ${$ref->{$_}} = $config->{$_}; } --- 4083,4089 ---- foreach (keys(%{$ref})) { ! if (defined($opt_rc->{$_})) { ! ${$ref->{$_}} = $opt_rc->{$_}; ! } elsif (defined($config->{$_})) { ${$ref->{$_}} = $config->{$_}; } |