1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Fixing "include"

This commit is contained in:
Pierre-Étienne Meunier 2018-11-22 11:40:03 +00:00
parent f1de24feb8
commit 0e8332ca2b

View file

@ -2,6 +2,7 @@
{
kernel = stdenv.hostPlatform.parsed.kernel.name;
abi = stdenv.hostPlatform.parsed.abi.name;
cpu = stdenv.hostPlatform.parsed.cpu.name;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName:
@ -11,10 +12,12 @@
features
) [] (builtins.attrNames feat);
include = includedFiles: src: builtins.filterSource (path: type:
lib.lists.any (f:
let p = toString (src + ("/" + f)); in
(path == p) || (type == "directory" && lib.strings.hasPrefix path p)
) includedFiles
lib.lists.any (f:
let p = toString (src + ("/" + f));
suff = lib.strings.removePrefix p path;
in
suff == "" || (lib.strings.hasPrefix "/" suff)
) includedFiles
) src;
exclude = excludedFiles: src: builtins.filterSource (path: type:
lib.lists.all (f: