python: support version comparison of values greater than 9

This commit is contained in:
Phillip Cloud 2021-09-16 16:59:38 -04:00
parent 38c2f51e85
commit b6f569db2a
No known key found for this signature in database
GPG key ID: D908212070FD785E

View file

@ -160,12 +160,12 @@ let
hasElem = needle: haystack: builtins.elem needle (builtins.filter (x: builtins.typeOf x == "string") (builtins.split " " haystack));
op = {
"true" = x: y: true;
"<=" = x: y: (unmarshal x) <= (unmarshal y);
"<" = x: y: (unmarshal x) < (unmarshal y);
"<=" = x: y: lib.versionAtLeast (unmarshal y) (unmarshal x);
"<" = x: y: lib.versionOlder (unmarshal x) (unmarshal y);
"!=" = x: y: x != y;
"==" = x: y: x == y;
">=" = x: y: (unmarshal x) >= (unmarshal y);
">" = x: y: (unmarshal x) > (unmarshal y);
">=" = x: y: lib.versionAtLeast (unmarshal x) (unmarshal y);
">" = x: y: lib.versionOlder (unmarshal y) (unmarshal x);
"~=" = v: c:
let
parts = builtins.splitVersion c;