From c485a932d9941c43ab603442da0db18a6929cca1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 16 Dec 2020 10:14:59 +0100 Subject: [PATCH] maintainers/scripts/update.nix: Do not traverse lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lists items are not directly accessible like attributes in attrsets are. This makes it hard to represent their address in `UPDATE_NIX_ATTR_PATH` environment variable passed to update scripts. Given that I only introduced list support for `gnome3` attribute set and we stopped using them there, let’s remove the list support again. NixOS modules are better place for package collections anyway. This was meant to go in with https://github.com/NixOS/nixpkgs/pull/98304 but got accidentally omitted somehow. --- maintainers/scripts/update.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/maintainers/scripts/update.nix b/maintainers/scripts/update.nix index 5bacf9dda6a8..1305e0947c72 100755 --- a/maintainers/scripts/update.nix +++ b/maintainers/scripts/update.nix @@ -34,7 +34,7 @@ let /* Recursively find all packages (derivations) in `pkgs` matching `cond` predicate. - Type: packagesWithPath :: AttrPath → (AttrPath → derivation → bool) → (AttrSet | List) → List + Type: packagesWithPath :: AttrPath → (AttrPath → derivation → bool) → AttrSet → List AttrPath :: [str] The packages will be returned as a list of named pairs comprising of: @@ -60,8 +60,6 @@ let if path == rootPath || evaluatedPathContent.recurseForDerivations or false || evaluatedPathContent.recurseForRelease or false then dedupResults (lib.mapAttrsToList (name: elem: packagesWithPathInner (path ++ [name]) elem) evaluatedPathContent) else [] - else if lib.isList evaluatedPathContent then - dedupResults (lib.imap0 (i: elem: packagesWithPathInner (path ++ [i]) elem) evaluatedPathContent) else [] else []; in