From fd3052901c13af372228502350c444dddc21cb6e Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Tue, 24 Sep 2019 10:47:34 +0200 Subject: [PATCH] lib/versions: expose splitVersion --- lib/default.nix | 2 ++ lib/versions.nix | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 18d2dfae1e18..f293a1defb11 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -134,5 +134,7 @@ let mergeAttrsByFuncDefaultsClean mergeAttrBy fakeSha256 fakeSha512 nixType imap; + inherit (versions) + splitVersion; }); in lib diff --git a/lib/versions.nix b/lib/versions.nix index 2c05445b3dd0..0e9d81ac78b1 100644 --- a/lib/versions.nix +++ b/lib/versions.nix @@ -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: