From: donghee yang Date: Thu, 16 Aug 2012 16:47:18 +0000 (+0900) Subject: [Title] Fixed a bug that it does not install secondly-depedent packages when multi-job X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57a226ece7a25539a819e5f1180c5d2cf4b83f1d;p=sdk%2Ftools%2Fsdk-build.git [Title] Fixed a bug that it does not install secondly-depedent packages when multi-job --- diff --git a/src/build_server/BuildJob.rb b/src/build_server/BuildJob.rb index 5d4e23c..9962355 100644 --- a/src/build_server/BuildJob.rb +++ b/src/build_server/BuildJob.rb @@ -762,10 +762,11 @@ class BuildJob src_path = @parent.source_path deps = @pkginfo.get_build_dependencies(@os) for dep in deps - pkg = get_local_package_of_dependency( dep, src_path ) - if not pkg.nil? then local_pkgs.push pkg end + pkgs = get_local_required_packages( dep, src_path ) + local_pkgs += pkgs end end + local_pkgs.uniq! #compatable os support compat_ok = true @@ -1146,6 +1147,39 @@ class BuildJob end + def get_local_required_packages( dep, src_path ) + pkgs = [] + + # use the target os if not specified + if dep.target_os_list.count != 0 then + dep_target_os = dep.target_os_list[0] + else + dep_target_os = @os + end + + sub_pkgs = @pkgsvr_client.get_install_dependent_packages(dep.package_name, + dep_target_os, false, true) + + # search + pkg_names = [ dep.package_name ] + pkg_names += sub_pkgs + pkg_names.uniq! + pkg_names.each { |pkg_name| + binpkgs = Dir.glob("#{src_path}/#{pkg_name}_*_#{dep_target_os}.zip") + if binpkgs.count > 0 then + pkg = binpkgs[0] + if pkg_name == dep.package_name then + version = Utils.get_version_from_package_file(pkg) + if not dep.match? version then return [] end + end + pkgs.push pkg + end + } + + return pkgs + end + + def remote_package_of_dependency_exist?(dep) # use the target os if not specified if dep.target_os_list.count != 0 then