mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
lib/versions: expose splitVersion
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user