OlafHaag / chocolatey-packages

Configurations for community packages on chocolatey.org, a Windows package/software manager.
MIT License
6 stars 4 forks source link

Repair XnViewMP Download Location #27

Open lefte opened 2 years ago

lefte commented 2 years ago
OlafHaag commented 2 years ago

Thanks, @lefte for your attempt, but this would only fix a single version, assuming the checksums still match. The actual search for a new version happens here: https://github.com/OlafHaag/chocolatey-packages/blob/2b28556b3b10f144f125d667614a154dc2bbf3f1/automatic/xnviewmp/update.ps1#L18

Since the author changed their versioning by prepending a leading zero in the file name, this messes up finding the correct file. On the website is says "1.3.0", but the filename contains "1.03.0". If there was a good way of finding the correct latest version, the leading zero would have to be removed for chocolatey, because the last version there is 1.3.0 and is considered newer than any minor version starting with a zero. If any part of the version is just a single zero, than that must not be removed.

lefte commented 2 years ago

Thanks, @lefte for your attempt, but this would only fix a single version, assuming the checksums still match. The actual search for a new version happens here:

https://github.com/OlafHaag/chocolatey-packages/blob/2b28556b3b10f144f125d667614a154dc2bbf3f1/automatic/xnviewmp/update.ps1#L18

Since the author changed their versioning by prepending a leading zero in the file name, this messes up finding the correct file. On the website is says "1.3.0", but the filename contains "1.03.0". If there was a good way of finding the correct latest version, the leading zero would have to be removed for chocolatey, because the last version there is 1.3.0 and is considered newer than any minor version starting with a zero. If any part of the version is just a single zero, than that must not be removed.

Very useful, I didn't notice the automatic package updater in the repo -- let me know if this new commit helps with the link URL parsing. I'm not sure what to do about the version comparison portion, as I'm pretty new to PowerShell and Chocolatey.

ivkusan commented 1 year ago

If I understand correctly, it's not the version (starting zero) that has changed but the location of the packages.

https://download.xnview.com/old_versions/XnView_MP/ - this one contains:

So the last commit by @lefte might work for finding the latest version (or any other for that matter).