gnome3.updateScript: fix tarball eval on nonexisting attrpaths

As reported in https://github.com/NixOS/nixpkgs/commit/974f11cb2972f470ab4b7a71fdf8f09dfdff562b#commitcomment-38735081,
the tarball will fail to evaluate when updateScript is given a non-existing attrPath because getAttrFromPath
uses abort, which terminates the evaluation.
This commit is contained in:
Jan Tojnar
2020-04-25 15:26:09 +02:00
parent 22133c6bf3
commit f544c293ec
+1 -1
View File
@@ -5,7 +5,7 @@ let
python = python3.withPackages (p: [ p.requests ]);
upperBoundFlag =
let
package = lib.getAttrFromPath (lib.splitString "." attrPath) pkgs;
package = lib.attrByPath (lib.splitString "." attrPath) (throw "Cannot find attribute ${attrPath}.") pkgs;
packageVersion = lib.getVersion package;
versionComponents = lib.versions.splitVersion packageVersion;
minorVersion = lib.versions.minor packageVersion;