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
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