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
|
getVersion pkgs.youtube-dl
|
||||||
=> "2016.01.01"
|
=> "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
|
/* Extract name with version from URL. Ask for separator which is
|
||||||
supposed to start extension.
|
supposed to start extension.
|
||||||
|
|
Loading…
Reference in New Issue