uninstall(pkg_name, false)
end
+ # TODO: Resolve conflicts
+
if trace then
install_dep_pkgs = pkg.install_dep_list
new_pkg_os = pkg_os
when "attribute" then return pkg.attribute
when "checksum" then return pkg.checksum
when "size" then return pkg.size
+ when "conflicts" then return pkg.conflicts
end
end
return pkg
end
+ private
+ def resolve_conflicts(pkg_name, os)
+ conflicts = get_attr_from_pkg(pkg_name, os, "conflicts")
+ conflicts.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"
+ return false
+ else
+ @log.info "Resolved conflict package [#{pkg.package_name}]"
+ end
+ end
+ end
+ return true
+ end
+
private
# install a package to @location after uninstalling and downloading
def install_pkg(pkg_name, os, force)
end
end
+ # resolve conflict packages
+ if not resolve_conflicts(pkg_name, os) then
+ @log.error "Failed to resolve conflicts [#{pkg_name}]"
+ return false
+ end
+
# install package
cached_filepath = nil
if Utils.is_linux_like_os( Utils::HOST_OS ) then