mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
fetchpatch: Add includes to compliment excludes, and require that both not be non-empty.
This commit is contained in:
parent
a260b3d681
commit
57bb96d659
@ -5,7 +5,7 @@
|
|||||||
# stripLen acts as the -p parameter when applying a patch.
|
# stripLen acts as the -p parameter when applying a patch.
|
||||||
|
|
||||||
{ lib, fetchurl, patchutils }:
|
{ lib, fetchurl, patchutils }:
|
||||||
{ stripLen ? 0, extraPrefix ? null, excludes ? [], ... }@args:
|
{ stripLen ? 0, extraPrefix ? null, excludes ? [], includes ? [], ... }@args:
|
||||||
|
|
||||||
fetchurl ({
|
fetchurl ({
|
||||||
postFetch = ''
|
postFetch = ''
|
||||||
@ -24,7 +24,9 @@ fetchurl ({
|
|||||||
${patchutils}/bin/filterdiff \
|
${patchutils}/bin/filterdiff \
|
||||||
-p1 \
|
-p1 \
|
||||||
${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
|
${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
|
||||||
|
${builtins.toString (builtins.map (x: "-i ${x}") includes)} \
|
||||||
"$tmpfile" > "$out"
|
"$tmpfile" > "$out"
|
||||||
${args.postFetch or ""}
|
${args.postFetch or ""}
|
||||||
'';
|
'';
|
||||||
} // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "postFetch"])
|
meta.broken = excludes != [] && includes != [];
|
||||||
|
} // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "includes" "postFetch"])
|
||||||
|
Loading…
Reference in New Issue
Block a user