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

View File

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