if (cjob.status == "WORKING" or cjob.status == "REMOTE_WORKING" ) and
(job.has_build_dependency?( cjob ) or job.is_compatible_with?( cjob)) then
pre_jobs.push cjob
- # # In case that "PENDING" job is depends on me (not depended )
- # elsif cjob.status == "PENDING" and (not job.does_depend_on? cjob) and
- # (job.has_build_dependency?( cjob ) or job.is_compatible_with?( cjob)) then
- # pre_jobs.push cjob
elsif check_dep_wait and cjob.status == "WAITING" and
(job.does_depend_on? cjob or
(job.id > cjob.id and job.is_compatible_with? cjob) ) then
def has_same_packages?( wjob )
- # must have same distribution
- if get_distribution_name() != wjob.get_distribution_name() then
- return false
- end
-
- # same package must have same os
- if not @os.eql? wjob.os then
- return false
- end
-
- # check package name
- get_packages.each do |pkg|
- wjob.get_packages().each do |wpkg|
- if pkg.package_name == wpkg.package_name then
- #puts "Removed from candiated... A == B"
- return true
+ @sub_jobs.each do |job2|
+ if wjob.type == "MULTIBUILD" then
+ wjob.sub_jobs.each do |wjob2|
+ if job2.has_same_packages?( wjob2 ) then return true end
end
- end
+ else
+ if job2.has_same_packages?( wjob ) then return true end
+ end
end
return false