From f929f38d5e9e5d2ed7bc0c21e7336de85246c84b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 26 Feb 2018 06:08:55 +0100 Subject: [PATCH] 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. --- maintainers/scripts/update.nix | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/maintainers/scripts/update.nix b/maintainers/scripts/update.nix index 2035950da3e..2c9c0b3bf45 100755 --- a/maintainers/scripts/update.nix +++ b/maintainers/scripts/update.nix @@ -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':