@ISA = qw(Exporter);
@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
our $maxflight;
+sub restrictflight_arg ($) {
+ my ($arg) = @_;
+ if ($arg =~ m/^--max-flight\=([1-9]\d*)$/) {
+ $maxflight = $1;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub restrictflight_cond () {
+ return defined($maxflight) ? "(flight <= $maxflight)" : "TRUE";
+}
+
our $green= '#008800';
our $red= '#ff8888';
our $yellow= '#ffff00';
$$1= $2;
} elsif (m/^--flight-limit\=([1-9]\d*)$/) {
$flightlimit= $1;
- } elsif (m/^--max-flight\=([1-9]\d*)$/) {
- $maxflight= $1;
+ } elsif (restrictflight_arg($_)) {
+ # handled by Executive
} elsif (m/^--blessings?=(.*)$/) {
push @blessings, split ',', $1;
} elsif (m/^--html-dir=(.*)$/) {
@ARGV or die $!;
-our $maxflightcond = defined($maxflight) ? "flight <= $maxflight" : "TRUE";
+our $restrictflight_cond = restrictflight_cond();
our $flightcond;
sub computeflightsrange () {
FROM (
SELECT flight
FROM flights
- WHERE $maxflightcond
+ WHERE $restrictflight_cond
ORDER BY flight DESC
LIMIT $flightlimit
) f
WHERE $namecond
AND ($valcond)
AND $flightcond
- AND $maxflightcond
+ AND $restrictflight_cond
ORDER BY flight DESC
LIMIT ($limit * 3 + 100) * ?
END