majkinetor / au

Chocolatey Automatic Package Updater Module
GNU General Public License v2.0
227 stars 71 forks source link

Prerelease non-SemVer2 version comparisons #265

Closed flcdrg closed 2 years ago

flcdrg commented 2 years ago

I have a problem with some of the JetBrains packages when their prerelease versions go beyond EAP9.. eg.

resharper-ultimate-all - checking updates using au version 2021.7.18

*** Stream: Release-Eap ***
URL check
  https://download.jetbrains.com/resharper/dotUltimate.2022.2.EAP11/JetBrains.dotUltimate.2022.2.EAP11.Checked.exe
nuspec version: 2022.2-EAP9
remote version: 2022.2-EAP11
No new version found

*** Stream: Release ***
URL check
  https://download.jetbrains.com/resharper/dotUltimate.2022.1.2/JetBrains.dotUltimate.2022.1.2.exe
nuspec version: 2022.1.2
remote version: 2022.1.2
No new version found

Path          : C:\dev\git\au-packages\resharper-ultimate-all
Name          : resharper-ultimate-all
Updated       : False
Pushed        : False
RemoteVersion : 2022.1.2
NuspecVersion : 2022.1.2
Result        : {resharper-ultimate-all - checking updates using au version 2021.7.18, , *** Stream: Release-Eap ***,
                URL check…}
Error         :
NuspecPath    : C:\dev\git\au-packages\resharper-ultimate-all\resharper-ultimate-all.nuspec
NuspecXml     : #document
Ignored       : False
IgnoreMessage :
StreamsPath   : C:\dev\git\au-packages\resharper-ultimate-all\resharper-ultimate-all.json
Streams       : {Release-Eap, Release}

Is there a way to intercept the version checking so that I can convert the semver1 versions to semver2, or inject my own comparison logic?

Once Chocolatey supports SemVer2 I can version these packages as EAP.9 and EAP.11 and they should compare correctly, but for now they're comparing EAP9 and EAP11 and the latter is sorted first, which is why it isn't updating.

majkinetor commented 2 years ago

You can massage version in au_GetLatest.... for intance insert leading zero there.

You can eventally do it again in BeforeUpdate

flcdrg commented 2 years ago

ah.. cool. I'll give that a go!

majkinetor commented 2 years ago

Adding 0 will work but it will finish as a version. If that is big deal to you you revert it back in BeforeUpdate. I personally think its not a big deal.

flcdrg commented 2 years ago

I think adding the zero should work. Don't think I can get this working for the current versions, but the next EAP release hopefully will work.