This is a string, a function of the job name, that identifies the
class of `other revisions'. It is empty for main-revision jobs
and currently there is only `<delimiter>prev' for build-*-prev.
We are going to use this in the bisector.
Reimplement main_revision_job_cond in terms of this. No functional
change, except that the SQL optimiser may have more work to do.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
getmethod
postfork
flight_otherjob
- main_revision_job_cond
+ main_revision_job_cond other_revision_job_suffix
$dbh_tests db_retry db_retry_retry db_retry_abort
db_begin_work db_prepare
ensuredir get_filecontents_core_quiet system_checked
die "$otherflightjob ?";
}
+sub other_revision_job_suffix ($$) {
+ my ($jobfield, $separator) = @_;
+ return <<END
+ (CASE
+ WHEN ($jobfield) LIKE 'build-%-prev' THEN '${separator}prev'
+ ELSE ''
+ END)
+END
+}
+
sub main_revision_job_cond ($) {
my ($jobfield) = @_;
- return "(($jobfield) NOT LIKE 'build-%-prev')";
+ return "(${\ other_revision_job_suffix($jobfield,'x') } = '')";
}
sub get_filecontents_core_quiet ($) { # ENOENT => undef