From f544c293ecc59a2e7c7be2deabe5f1cb5b7c160b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 25 Apr 2020 15:23:35 +0200 Subject: [PATCH] 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. --- pkgs/desktops/gnome-3/update.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome-3/update.nix b/pkgs/desktops/gnome-3/update.nix index 555504086a4..506c265270c 100644 --- a/pkgs/desktops/gnome-3/update.nix +++ b/pkgs/desktops/gnome-3/update.nix @@ -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;