Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchpatch: quote excludes #43538

Merged
merged 4 commits into from
Jul 19, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkgs/build-support/fetchpatch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -23,8 +23,10 @@ fetchurl ({
--clean "$out" > "$tmpfile"
${patchutils}/bin/filterdiff \
-p1 \
${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \
${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg 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"])