From 661415d4ebe11b8c9b9c973f6909237c4cb6e92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sat, 13 Aug 2016 17:16:37 +0200 Subject: [PATCH] getVersion: first try drv.version before parsing drv.name --- lib/strings.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index 89169411a021..86af4d438344 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -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.