mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
lib/versions: expose splitVersion
This commit is contained in:
parent
d484f2b7fc
commit
fd3052901c
@ -134,5 +134,7 @@ let
|
||||
mergeAttrsByFuncDefaultsClean mergeAttrBy
|
||||
fakeSha256 fakeSha512
|
||||
nixType imap;
|
||||
inherit (versions)
|
||||
splitVersion;
|
||||
});
|
||||
in lib
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user