From 0d4a0aec44b1f032f2d148311a3d228874c1ebc6 Mon Sep 17 00:00:00 2001 From: Todd Lyons Date: Sat, 19 Oct 2013 07:46:43 -0700 Subject: [PATCH] Add --override option Allows overriding conf options when testing. Bugfix: features displayed always, only show when step requested. --- EximBuild/Options.pm | 5 +++-- run_build.pl | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/EximBuild/Options.pm b/EximBuild/Options.pm index 1ce7865..d0a5583 100644 --- a/EximBuild/Options.pm +++ b/EximBuild/Options.pm @@ -23,7 +23,7 @@ BEGIN @option_list =qw( $forcerun $buildconf $keepall $help $quiet $from_source $from_source_clean $testmode - $skip_steps $only_steps + $skip_steps $only_steps $override $nosend $nostatus $verbose ); } @@ -41,7 +41,7 @@ use vars qw($VERSION); $VERSION = 'REL_0.1'; our ( $forcerun, $buildconf, $keepall,$help, $quiet, $from_source,$from_source_clean, $testmode, - $skip_steps,$only_steps, + $skip_steps,$only_steps, $overrides, $nosend, $nostatus, $verbose, ); @@ -61,6 +61,7 @@ my (%standard_options); 'quiet' => \$quiet, 'skip-steps=s' => \$skip_steps, 'only-steps=s' => \$only_steps, + 'override=s@' => \$overrides, ); $buildconf = "build-farm.conf"; # default value diff --git a/run_build.pl b/run_build.pl index 7e9ab32..2374688 100755 --- a/run_build.pl +++ b/run_build.pl @@ -178,6 +178,17 @@ my $scm_timeout_secs = $EximBuild::conf{scm_timeout_secs} print scalar(localtime()),": buildfarm run for $animal:$branch starting\n" if $verbose; +# Allow commandline overrides of conf variables +foreach my $arg ( @{$EximBuild::Options::overrides} ) +{ + if (my ($key,$val) = split '=', $arg) + { + $EximBuild::conf{$key} = $val; + printf "Commandline override: '$key' = '%s'\n", $EximBuild::conf{$key} + if $verbose; + } +} + if (ref($force_every) eq 'HASH') { $force_every = $force_every->{$branch} || $force_every->{default}; @@ -793,6 +804,7 @@ sub writelog sub display_features { + return unless step_wanted('features'); my @out = `cd $exim src/build-*/exim -C test/confs/0000 -bV `; my $status = $? >>8; -- 2.30.2