|
|
|
@ -472,6 +472,23 @@ rec { |
|
|
|
|
*/ |
|
|
|
|
versionAtLeast = v1: v2: !versionOlder v1 v2; |
|
|
|
|
|
|
|
|
|
/* This function takes an argument that's either a derivation or a |
|
|
|
|
derivation's "name" attribute and extracts the name part from that |
|
|
|
|
argument. |
|
|
|
|
|
|
|
|
|
Example: |
|
|
|
|
getName "youtube-dl-2016.01.01" |
|
|
|
|
=> "youtube-dl" |
|
|
|
|
getName pkgs.youtube-dl |
|
|
|
|
=> "youtube-dl" |
|
|
|
|
*/ |
|
|
|
|
getName = x: |
|
|
|
|
let |
|
|
|
|
parse = drv: (builtins.parseDrvName drv).name; |
|
|
|
|
in if isString x |
|
|
|
|
then parse x |
|
|
|
|
else x.pname or (parse x.name); |
|
|
|
|
|
|
|
|
|
/* This function takes an argument that's either a derivation or a |
|
|
|
|
derivation's "name" attribute and extracts the version part from that |
|
|
|
|
argument. |
|
|
|
|