lib/versions: expose splitVersion

This commit is contained in:
Joachim Fasting 2019-09-24 10:47:34 +02:00
parent d484f2b7fc
commit fd3052901c
No known key found for this signature in database
GPG Key ID: 5C204DF675C90294
2 changed files with 9 additions and 5 deletions

View File

@ -134,5 +134,7 @@ let
mergeAttrsByFuncDefaultsClean mergeAttrBy
fakeSha256 fakeSha512
nixType imap;
inherit (versions)
splitVersion;
});
in lib

View File

@ -1,14 +1,16 @@
/* Version string functions. */
{ lib }:
let
rec {
/* Break a version string into its component parts.
Example:
splitVersion "1.2.3"
=> ["1" "2" "3"]
*/
splitVersion = builtins.splitVersion or (lib.splitString ".");
in
{
/* Get the major version string from a string.
Example: