-
-
Notifications
You must be signed in to change notification settings - Fork 154
Fix version count #5922
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
base: master
Are you sure you want to change the base?
Fix version count #5922
Conversation
* Transform "101" into "1.1" | ||
* Transform "0590" into "5.90" | ||
* Transform "250208 into 25.2.8 | ||
* Transform "031400 into 3.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think indeed for humanLizmapTargetVersion
, it makes sense to strip the patch number, because it's a about a "branch" number (and there will be never a patch number into this string).
But for lizmapDesktopRecommended
or any other "precise version" (not talking about a branch), it would make sense to always have the patch number, even if .0.
Maybe adding a flag "strip patch number" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or similar to the other function within this file dropBuildId
, having dropPatchNumber
? (which obviously drops the build id). Just an idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add an optionnal stripPatch
boolean argument (default false)
Also, fixed blocking version : (3.8 - 0.1 = 3.7 but 3.15 - 0.1 = 3.05) so i use int version - 100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for cleaning these versions logic !
@@ -90,4 +90,27 @@ public static function qgisVersionWithNameToInt(string $versionString): int | |||
|
|||
return intval(intval($version[0]) * 10000 + intval($version[1]) * 100 + intval($version[2])); | |||
} | |||
|
|||
/** | |||
* Transform int formatted version to a human readable string (remove useless 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Transform int formatted version to a human readable string (remove useless 0), | |
* Transform int formatted version to a human readable string (remove useless 0 if needed), |
* Transform "101" into "1.1" | ||
* Transform "0590" into "5.90" | ||
* Transform "250208 into 25.2.8 | ||
* Transform "031400 into 3.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Transform "031400 into 3.14 | |
* Transform "031400 into 3.14 if stripPatch is True | |
* Transform "031400 into 3.14.0 if stripPatch is False |
Code comment for previous version calculation Co-authored-by: Étienne Trimaille <gustrimaille@yahoo.fr>
add
VersionTools:intVersionToHumanString
method to convert int version to human readable stringexample :
030506
means3.5.6
,keep the
intVersionToSortableString
to allow sortable string ( "03.10.XX" > "03.09.YY" but 3.10 < 3.9), so update js to convert "sortable" string to a human stringTicket : #5855
Funded by 3Liz