KSP-CKAN / CKAN

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

Importing .ckan also selects conflicting recommends #2724

Closed diveyez closed 5 years ago

diveyez commented 5 years ago

Importing .ckan also selects conflicting recommends

DasSkelett commented 5 years ago

Please fill out the questions of the template. Also, which mods did you import? Which recommends did you select? How to reproduce? Which mods were conflicting? There's no way we can help you if you give us only one sentence.

4x4cheesecake commented 5 years ago

Not quiet sure if this is the same issue but I just noticed that CKAN tries to install both versions of "Custom Barn Kit" when you import it from a .ckan file. There is one version for the stock game, and a second one for "Realisim Overhaul". These versions are conflicting with each other. There is no difference if "Custom Barn Kit" got installed as an dependency or if it got selected manually.

To reproduce the issue, install "Custom Barn Kit", export the installed mods as .ckan file, uninstall "Custom Barn Kit" again and try to reinstall it by importing the .ckan file.

DasSkelett commented 5 years ago

@4x4cheesecake thanks, that might be the issue @diveyez "describes", and I think I got it. CKAN selects all recommended mods by default, even if there are some conflicting with others. image

It would be nice if CKAN marks all conflicts and only selects / lets you select non-conflicting mods in the recommendations (suggestions too?) tab.

4x4cheesecake commented 5 years ago

In my opinion, CKAN should not select two mods if there is just one listed in the .ckan file. Highlighting conflicting mods would be one way to deal with it but that's more like a workaorund, isn't it? A .ckan file should always install exactly the mods listed in it. Also, this doesn't happen if you run the same procedure with the RO build of Custom Barn Kit (and I didn't came across any other mod which causes the same issue), so I have the gut feeling, this is actually caused during deserialization of the .ckan file.

HebaruSan commented 5 years ago

I think what's being highlighted here is an effect of the "provides" property; CustomBarnKit-RO provides CustomBarnKit, so it can be pulled in whenever a relationship references CustomBarnKit.

https://github.com/KSP-CKAN/NetKAN/blob/master/NetKAN/CustomBarnKit.netkan https://github.com/KSP-CKAN/NetKAN/blob/master/NetKAN/CustomBarnKit-RO.netkan

There are many other examples of this throughout the metadatabase. This gives us a smooth way to handle cases where a mod recommends XYZ but all we have indexed for the current version is XYZContinued (among other things).

One option might be to create a new property for relationships, something like "exact_only": true.

    "recommends": [
        { "name": "CustomBarnKit", "exact_only": true }
    ]

This would turn off the "provides" logic for a specific relationship, so only the exact identifier match would be pulled in. A typical mod would have no use for this, but an exported .ckan file could add it to all of the depends/recommends to ensure that the mod list is transferred verbatim.