tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fetchpatch: add excludes parameter
Robin Gloster
8 years ago
100107a3
1ec5b7f1
+6
-3
1 changed file
expand all
collapse all
unified
split
pkgs
build-support
fetchpatch
default.nix
+6
-3
pkgs/build-support/fetchpatch/default.nix
···
5
5
# stripLen acts as the -p parameter when applying a patch.
6
6
7
7
{ lib, fetchurl, patchutils }:
8
8
-
{ stripLen ? 0, addPrefixes ? false, ... }@args:
8
8
+
{ stripLen ? 0, addPrefixes ? false, excludes ? [], ... }@args:
9
9
10
10
fetchurl ({
11
11
postFetch = ''
···
21
21
--addnewprefix=b/ \
22
22
''} \
23
23
--clean "$out" > "$tmpfile"
24
24
-
mv "$tmpfile" "$out"
24
24
+
${patchutils}/bin/filterdiff \
25
25
+
-p1 \
26
26
+
${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
27
27
+
"$tmpfile" > "$out"
25
28
${args.postFetch or ""}
26
29
'';
27
27
-
} // builtins.removeAttrs args ["stripLen" "addPrefixes"])
30
30
+
} // builtins.removeAttrs args ["stripLen" "addPrefixes" "excludes"])