jakobkmar / pacmc

An easy-to-use package manager (and soon to be launcher) for Minecraft mods.
GNU Affero General Public License v3.0
122 stars 9 forks source link

Dependencies installed twice if modrinth/curseforge mods are mixed together #45

Closed endrjux closed 2 years ago

endrjux commented 2 years ago

The troublesome mod from #41 is now available from Modrinth. Installing it gives:

+ add modrinth/entityculling (1.5.1-fabric-1.18)
+ add modrinth/fabric-api (0.53.4+1.18.2) (dependency)

Which is kinda correct but not really, because I already have fabric-api installed from curseforge as a dependency of other mods from there. I think it might not even be possible to accurately say if two mods from different sources are in fact the same mod. (Well, mod name will be most likely the same, but you never know)

Moreover, pacmc doesn't allow to uninstall this additional mod afterwards, as it's a required dependency.

This is somewhat related to #20. Pacmc now asks if the list of the mods to be installed is correct. If it asked after resolving dependencies it would be possible to select which mods from the list should actually be installed. (That would of course require additional feature to select mods, now you can only answer y/n)

jakobkmar commented 2 years ago

Hey, I know this looks like a bug at first, but I decided go with this behaviour on purpose. The reason is that detecting duplicates in a reliable way is not really possible. Additionally, when detected correctly, handling these duplicates is also very hard, since there are lots of different situations where one repo would be preferred over the other and vice versa. Also, the preferred repo might change at any time. In the end, it was just the easiest to download the file multiple times and let the loader handle duplicated mods. This is actually no problem since e.g. Fabric does not crash with duplicated mods, and instead always takes the best version (which often is the most recent version) and loads that one.

I hope that this understandable - if you have any concerns, please let me know!

Moreover, pacmc doesn't allow to uninstall this additional mod afterwards, as it's a required dependency.

Yes, a pacmc exclude command is planned.

endrjux commented 2 years ago

Ah, ok. If it doesn't crash then it's fine. (TBH I didn't even try, I assumed it'll crash :-D) That's reasonable and I too think it would be hard to correctly asses which mods are duplicates.

rvveber commented 2 years ago

You could compare checksums of existing files with checksums of to be installed files to find out if they are duplicates?