[Title] Fixed a bug about checking dependency of multi job
authordonghee yang <donghee.yang@samsung.com>
Fri, 5 Apr 2013 00:41:35 +0000 (09:41 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Fri, 5 Apr 2013 00:41:35 +0000 (09:41 +0900)
src/build_server/JobManager.rb
src/build_server/MultiBuildJob.rb

index 71b98e65617c599196e958f3cd3656b73764483f..5bfbf409bd7664a5c4bf275eeda02fbc4d5d65e9 100644 (file)
@@ -533,10 +533,6 @@ class JobManager
                                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
index 1669fce2e95d39abce9f3c62b09aea03df4d19b3..edd3acb8cebb77d31c0768f24b67beb690caa0b3 100644 (file)
@@ -270,24 +270,14 @@ class MultiBuildJob < CommonJob
 
 
        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