Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing version sorting of _ vs . #1554

Merged
merged 4 commits into from
Feb 22, 2016
Merged

Fixing version sorting of _ vs . #1554

merged 4 commits into from
Feb 22, 2016

Conversation

distantcam
Copy link
Contributor

The NavUtilities versions were not being sorted properly. Currently the sort is

  • 0.5_RC_3
  • 0.5.1_RC_1_repacked
  • 0.4.3

It should be

  • 0.5.1_RC_1_repacked
  • 0.5_RC_3
  • 0.4.3

This change modifies the sort so that '.' takes precedence over all other non-digit characters. That way version parts are considered higher than other random characters tacked onto the end of the version.

All the other version tests pass.

@mheguy
Copy link
Contributor

mheguy commented Dec 28, 2015

Tested this some, and it does correctly bring forward the correct version for NavUtils. It also brings forth Deep Space Utilities properly which closes KSP-CKAN/CKAN-meta#919. This also addresses many cases of #1327.

@politas as you've been poking around with sorting for a little while, would you mind trying the build out to see if it generates and/or fixes any outstanding issues? (.zip with debug for convenience, you can just extract the folder and run ckan.exe)

@distantcam
Copy link
Contributor Author

I found another example that could possibly break the versioning. I've updated this PR to solve that scenario too.

ModularFlightIntegrator had versions:

  • 1.1.2.0
  • 1.1.1
  • 1.1.0.0
  • 1.0.repackaged0
  • 1.0

I added a test for the uneven version lengths (1.1.0.0 vs 1.1.1) and fixed the case where a patch number could cause the sort to fail (for example, if there had been a 1.0.1 version in the list above).

@politas
Copy link
Member

politas commented Dec 29, 2015

Ok, I'm trying to use that version, but I don't seem to be getting any updates to metadata when I refresh using it. NavUtilities 0.5.1_RC_1_repacked does show up as the latest version, but its saying its Max KSP is v1.0.4, and since the CKAN file for that version definitely says 1.0.5 now, I can't trust that I'm properly testing anything. Is there a way to clear the local CKAN metadata store while not losing the installed mods data?

@distantcam
Copy link
Contributor Author

@politas Could you please try refreshing again? The NavUtilities metadata is up-to-date for me when I refresh.

@politas
Copy link
Member

politas commented Jan 3, 2016

Ok. Looks fine. The few remaining cases where it's picking up obsoleted versions are not ones that a _/. sorting change will fix. Hasn't created any issues I can see.

@Olympic1
Copy link
Member

Olympic1 commented Feb 9, 2016

I can also confirm that this works as intended, it shows the correct version.

@Olympic1 Olympic1 merged commit 4d96621 into KSP-CKAN:master Feb 22, 2016
Olympic1 added a commit that referenced this pull request Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants