many scripts failed when reading no-version-check from global config file - 1361293

This commit is contained in:
Frank Cizmich
2014-10-06 19:04:49 -02:00
parent 4ba15b4887
commit dc4c506483
17 changed files with 141 additions and 27 deletions

View File

@@ -1132,6 +1132,16 @@ sub _read_config_file {
$parse = 0;
next LINE;
}
# Silently ignore option [no]-version-check if it is unsupported and it comes from a config file
# TODO: Ideally , this should be generalized for all unsupported options that come from global files
if ( $parse
&& !$self->has('version-check')
&& $line =~ /version-check/
) {
next LINE;
}
if ( $parse
&& (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/)
) {

View File

@@ -347,6 +347,9 @@ _parse_config_files() {
# Skip blank lines.
[ "$config_opt" = "" ] && continue
# Skip global option [no]version-check which don't apply
echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue
# Options in a config file are not prefixed with --,
# but command line options are, so one or the other has
# to add or remove the -- prefix. We add it for config