From 354ab7361008d1ab1fda50ce6440ae6e0ac60d31 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 23 Jul 2015 18:32:16 +0100 Subject: [PATCH] Flight restriction: Change implementation of --max-flight Abolish $maxflight. All the users outside Osstest::Executive have been eliminated, so this is fine. Replace it with $restrictflight_cond, which can accumulate multiple conditions. There is a minor functional change: when multiple --max-flight options are specified, _all_ of them take effect (effectively using the lowest value). That option is not used in production, and I don't expect people elsewhere to be passing multiple different such options. Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- Osstest/Executive.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index a1bc0ad..b8ab5cd 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -47,7 +47,6 @@ BEGIN { @EXPORT = qw(get_harness_rev grabrepolock_reexec findtask @all_lock_tables restrictflight_arg restrictflight_cond - $maxflight report_run_getinfo report_altcolour report_blessingscond report_find_push_age_info tcpconnect_queuedaemon plan_search @@ -195,12 +194,12 @@ sub opendb ($) { #---------- history reporting ---------- -our $maxflight; +our $restrictflight_cond = 'TRUE'; sub restrictflight_arg ($) { my ($arg) = @_; if ($arg =~ m/^--max-flight\=([1-9]\d*)$/) { - $maxflight = $1; + $restrictflight_cond .= " AND flight <= $1"; return 1; } else { return 0; @@ -208,7 +207,7 @@ sub restrictflight_arg ($) { } sub restrictflight_cond () { - return defined($maxflight) ? "(flight <= $maxflight)" : "TRUE"; + return "($restrictflight_cond)"; } our $green= '#008800'; -- 2.39.5