Quantcast WoWInterface - View Single Post - Minion cant count
View Single Post
10-21-15, 01:16 PM   #11
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Rilgamon View Post
Please describe in 3 sentences the logic of version numbers so that a parser can "read" it as a compareable value.
Please show me an example of an addon using such a versioning scheme. I have never seen one. I have seen:


...and that, along with pretty much every verison numbering scheme I've seen mis-detected in Minion, is easily parsed with a few simple rules -- strip "^r%s*", "^v%s*", and other common meaningless prefixes; split on . and - characters; and do simple sorts on the parts. You'd need an additional rule to cover "6.2 Beta" vs "6.2 Release/Stable" and you wouldn't be able to parse Git hashes in WowAce alpha packages, but for the most part, it's very doable. Yes, there will be a few "special" versioning schemes (I'm looking at you, OPie) that can't easily be handled this way, but again, for the most part, it's just not this hard.

Tonyleila's suggestion about comparing the dates is a good one in a perfect world, but may not always be reliable since you can't control how files on the user's machine are timestamped. Let's say an addon is on both Curse and WoWI. The version on Curse is version 5 and was released in December 2013. The version on WoWI is version 12 and was released in August 2015. Now let's say the user just found this addon on Curse and installed it today (October 2015). Now the files on their computer are (definitely if they installed with the Curse Client, and maybe if they installed manually, depending on their software and how it's configured) marked as created/modified October 2015, so checking that against the August 2015 date of the newer version on WoWI will fail.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote