mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 13:57:10 +03:00
Merge pull request #104773 from adisbladis/texlive-unique
texlive: Use lib.unique for uniqueness checks
This commit is contained in:
commit
4160889b5f
@ -31,13 +31,7 @@ let
|
|||||||
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: replace by buitin once it exists
|
uniqueStrings = list: lib.sort (a: b: a < b) (lib.unique list);
|
||||||
fastUnique = comparator: list: with lib;
|
|
||||||
let un_adj = l: if length l < 2 then l
|
|
||||||
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
|
|
||||||
in un_adj (lib.sort comparator list);
|
|
||||||
|
|
||||||
uniqueStrings = fastUnique (a: b: a < b);
|
|
||||||
|
|
||||||
mkUniqueOutPaths = pkgs: uniqueStrings
|
mkUniqueOutPaths = pkgs: uniqueStrings
|
||||||
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));
|
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));
|
||||||
|
Loading…
Reference in New Issue
Block a user