summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchpatch
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-07-26 12:59:02 +0200
committerRobin Gloster <mail@glob.in>2017-07-26 13:32:59 +0200
commit100107a3cd166da87b527eabf49f477ea2d18c9f (patch)
tree4a79217caebec478ef0493b3cd0d651a1bea52ca /pkgs/build-support/fetchpatch
parentmailutils: 2.2 -> 3.2 (diff)
downloadnixpkgs-100107a3cd166da87b527eabf49f477ea2d18c9f.tar.gz
fetchpatch: add excludes parameter
Diffstat (limited to 'pkgs/build-support/fetchpatch')
-rw-r--r--pkgs/build-support/fetchpatch/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix
index a6ddf132cd5b..a9bfac320fb8 100644
--- a/pkgs/build-support/fetchpatch/default.nix
+++ b/pkgs/build-support/fetchpatch/default.nix
@@ -5,7 +5,7 @@
# stripLen acts as the -p parameter when applying a patch.
{ lib, fetchurl, patchutils }:
-{ stripLen ? 0, addPrefixes ? false, ... }@args:
+{ stripLen ? 0, addPrefixes ? false, excludes ? [], ... }@args:
fetchurl ({
postFetch = ''
@@ -21,7 +21,10 @@ fetchurl ({
--addnewprefix=b/ \
''} \
--clean "$out" > "$tmpfile"
- mv "$tmpfile" "$out"
+ ${patchutils}/bin/filterdiff \
+ -p1 \
+ ${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
+ "$tmpfile" > "$out"
${args.postFetch or ""}
'';
-} // builtins.removeAttrs args ["stripLen" "addPrefixes"])
+} // builtins.removeAttrs args ["stripLen" "addPrefixes" "excludes"])