maintainers/scripts/update.nix: deduplicate packages

Lot of my GNOME packages have several legacy aliases,
which causes them to be updated multiple times.

This patch uses lib.unique to remove the duplicates.
This commit is contained in:
Jan Tojnar 2018-02-26 06:08:55 +01:00
parent 4145f5e3b0
commit f929f38d5e
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -9,22 +9,24 @@ let
pkgs = import ./../../default.nix { }; pkgs = import ./../../default.nix { };
packagesWith = cond: return: set: packagesWith = cond: return: set:
pkgs.lib.flatten pkgs.lib.unique
(pkgs.lib.mapAttrsToList (pkgs.lib.flatten
(name: pkg: (pkgs.lib.mapAttrsToList
let (name: pkg:
result = builtins.tryEval ( let
if pkgs.lib.isDerivation pkg && cond name pkg result = builtins.tryEval (
then [(return name pkg)] if pkgs.lib.isDerivation pkg && cond name pkg
else if pkg.recurseForDerivations or false || pkg.recurseForRelease or false then [(return name pkg)]
then packagesWith cond return pkg else if pkg.recurseForDerivations or false || pkg.recurseForRelease or false
then packagesWith cond return pkg
else []
);
in
if result.success then result.value
else [] else []
); )
in set
if result.success then result.value
else []
) )
set
); );
packagesWithUpdateScriptAndMaintainer = maintainer': packagesWithUpdateScriptAndMaintainer = maintainer':