diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-06-04 22:29:22 -0400 |
---|---|---|
committer | Timo Kaufmann <timokau@zoho.com> | 2018-07-15 09:56:41 +0200 |
commit | aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7 (patch) | |
tree | d077a445e9f8d17bffc2c4b04df4832494da19d7 /pkgs/build-support/fetchpatch | |
parent | 064bff0ae0bc5b3ddb63e10aea0c883f341fd0b5 (diff) | |
download | nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar.gz nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar.bz2 nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar.lz nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar.xz nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.tar.zst nixlib-aa6adfc324b44c840a488a4b0a5cd4c1c66f80c7.zip |
fetchpatch: Add includes to compliment excludes, and require that both not be non-empty.
This commit was originally introduced as part of #41420 and then reverted with the rest of that PR. However there was no reason to revert his particular commit.
Diffstat (limited to 'pkgs/build-support/fetchpatch')
-rw-r--r-- | pkgs/build-support/fetchpatch/default.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index c185497e6913..16343d626ce7 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, extraPrefix ? null, excludes ? [], ... }@args: +{ stripLen ? 0, extraPrefix ? null, excludes ? [], includes ? [], ... }@args: fetchurl ({ postFetch = '' @@ -24,7 +24,9 @@ fetchurl ({ ${patchutils}/bin/filterdiff \ -p1 \ ${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \ + ${builtins.toString (builtins.map (x: "-i ${x}") includes)} \ "$tmpfile" > "$out" ${args.postFetch or ""} ''; -} // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "postFetch"]) + meta.broken = excludes != [] && includes != []; +} // builtins.removeAttrs args ["stripLen" "extraPrefix" "excludes" "includes" "postFetch"]) |