Skip to content

Commit

Permalink
maintainers/scripts/update.nix: Do not traverse lists
Browse files Browse the repository at this point in the history
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 NixOS#98304
but got accidentally omitted somehow.
  • Loading branch information
jtojnar committed Dec 16, 2020
1 parent f79dfa8 commit c485a93
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions maintainers/scripts/update.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let

/* Recursively find all packages (derivations) in `pkgs` matching `cond` predicate.
Type: packagesWithPath :: AttrPath → (AttrPath → derivation → bool) → (AttrSet | List) → List<AttrSet{attrPath :: str; package :: derivation; }>
Type: packagesWithPath :: AttrPath → (AttrPath → derivation → bool) → AttrSet → List<AttrSet{attrPath :: str; package :: derivation; }>
AttrPath :: [str]
The packages will be returned as a list of named pairs comprising of:
Expand All @@ -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
Expand Down

0 comments on commit c485a93

Please sign in to comment.