manifest_path = File.join(path, manifest_file)
pkg = Parser.read_single_pkginfo_from manifest_path
new_pkg_ver = pkg.version
+ pkg_conflicts = pkg.conflicts
FileUtils.remove_dir(path, true)
rescue Interrupt
@log.error "Client: Interrupted.."
end
# TODO: Resolve conflicts
+ if not resolve_conflicts_internal(pkg_conflicts) then
+ @log.error "Failed to resolve conflicts [#{pkg_name}]"
+ return false
+ end
+
if trace then
install_dep_pkgs = pkg.install_dep_list
end
private
- def resolve_conflicts(pkg_name, os)
- conflicts = get_attr_from_pkg(pkg_name, os, "conflicts")
- conflicts.each do |pkg|
+ def resolve_conflicts_internal(conflicts_pkgs)
+ if conflicts_pkgs.nil? then return true end
+ conflicts_pkgs.each do |pkg|
if check_installed_pkg(pkg.package_name) then
if not uninstall(pkg.package_name, true) then
@log.error "Failed to uninstall [#{pkg.package_name}] package for resolving"
end
end
return true
+ end
+
+ private
+ def resolve_conflicts(pkg_name, os)
+ conflicts = get_attr_from_pkg(pkg_name, os, "conflicts")
+ return resolve_conflicts_internal(conflicts)
end
private