KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.99k stars 348 forks source link

Refactor relationship resolver to capture full resolved tree #4232

Closed HebaruSan closed 1 month ago

HebaruSan commented 1 month ago

Problems

If you use ckan install -c modpack.ckan to install a modpack with incompatible dependencies, the message is something like:

Module installed-Auto-KSP 2024.05.15.01.03.25 required but it is not listed in the 
index, or not available for your version of KSP
If you're lucky, you can do a `ckan update` and try again.
Try `ckan install --no-recommends` to skip installation of recommended modules.
Or `ckan install --allow-incompatible` to ignore module compatibility.

This does not explain the problem, can only report one problem with one mod, and almost all of the advice at the bottom is useless. A similar poor message can also appear in GUI if the user force-selects a mod with incompatible dependencies on the Versions tab.

Causes

When the relationship resolver checks dependencies recursively to make sure a mod can be installed, it loses the information from the "leaf nodes" and just reports the outermost mod that can't be resolved.

Changes

Fixes #4108.

Side fixes

While working on the above, I tossed in a few opportunistic fixes: