Merge pull request #23768 from benley/lib-whitespace

lib: fix mixed tab/space indents, trailing whitespace, etc
This commit is contained in:
Jörg Thalheim 2017-03-12 22:28:29 +01:00 committed by GitHub
commit 212efab7ac
6 changed files with 110 additions and 107 deletions

View File

@ -164,8 +164,10 @@ rec {
in y ++ go (tail xs) (y ++ acc);
in go inputList acc;
uniqListExt = {inputList, outputList ? [],
getter ? (x : x), compare ? (x: y: x==y)}:
uniqListExt = { inputList,
outputList ? [],
getter ? (x: x),
compare ? (x: y: x==y) }:
if inputList == [] then outputList else
let x = head inputList;
isX = y: (compare (getter y) (getter x));
@ -176,8 +178,6 @@ rec {
inherit getter compare;
};
condConcat = name: list: checker:
if list == [] then name else
if checker (head list) then
@ -346,7 +346,10 @@ rec {
# See misc.nix -> versionedDerivation
# discussion: nixpkgs: pull/310
mergeAttrsByVersion = name: version: attrsByVersion: base:
mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];
mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; }
base
(maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)
];
# sane defaults (same name as attr name so that inherit can be used)
mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }