sargunv / modsman

Minecraft mod manager and updater for the CLI
Apache License 2.0
29 stars 7 forks source link

Advanced version matching (arbitrary regex?) #7

Open magneticflux- opened 4 years ago

magneticflux- commented 4 years ago

Currently, matching is done using substrings. This works for matching 1.15 to normal versions like 1.15, 1.15.1, and 1.15.2, but it also matches versions like 1.15-Snapshot that aren't desirable.

I encountered this issue when trying to update two mods. One has versions released for 1.15.1 (that are untagged but work with 1.15.2) and one has versions released for 1.15.2 as well as 1.15-Snapshot. If I allow all 1.15 versions, the first mod can update but the second mod tries to update to the snapshot version which may or may not work. If I only allow 1.15.2 versions, the first mod can't update but the second mod selects the correct version.

Some potential solutions:

sargunv commented 4 years ago

The latest version already has the ability to exclude versions, so you can exclude "1.15-Snapshot".

sargunv commented 4 years ago

I would like to have arbitrary version matching expressions, but it's pretty low pri. Will keep the issue open to track that

magneticflux- commented 4 years ago

I tried that, but it excludes mods that are tagged properly as supporting 1.15.2 and 1.15-Snapshot.

sargunv commented 4 years ago

Ah, I see what you mean. But in that case, isn't updating to the 1.15.2/1.15-Snapshot version fine? Or was the 1.15.1 version uploaded more recently, causing Modsman to pick that?

magneticflux- commented 4 years ago

Sorry, there's actually 3 types of mods that results in different errors. There's the two I described above, but the third is one that is tagged as supporting 1.15, 1.15.1, 1.15.2, and 1.15-Snapshot. This is the mod that prevents me from just excluding anything tagged as 1.15-Snapshot.

The second type I described above has 1.15-Snapshot versions uploaded after 1.15.2 versions, causing Modsman to pick the snapshot version.

sargunv commented 4 years ago

Okay, I understand the situation now. Yeah this can be fixed by adding the ability to match versions with regex instead of substrings, so you'd match something like ^1\.15(\.\d+)?$.

In the meantime, I recommend using the version pinning feature to prevent Modsman from updating the one problematic mod.