mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
getVersion: first try drv.version before parsing drv.name
This commit is contained in:
parent
a7f8787dbd
commit
661415d4eb
|
@ -372,7 +372,12 @@ rec {
|
|||
getVersion pkgs.youtube-dl
|
||||
=> "2016.01.01"
|
||||
*/
|
||||
getVersion = x: (builtins.parseDrvName (x.name or x)).version;
|
||||
getVersion = x:
|
||||
let
|
||||
parse = drv: (builtins.parseDrvName drv).version;
|
||||
in if isString x
|
||||
then parse x
|
||||
else x.version or (parse x.name);
|
||||
|
||||
/* Extract name with version from URL. Ask for separator which is
|
||||
supposed to start extension.
|
||||
|
|
Loading…
Reference in a new issue