Skip to content

Commit

Permalink
fetchpatch: escape excludes and includes
Browse files Browse the repository at this point in the history
Excludes and includes are implemented by passing the parameters to the
respective flags of `filterdiff`. Those were passed unescaped until now.
Since those flags expect patterns (similar to shell globs), something
like `/some/path/*` might be used to exclude or include all files in
some path. Without escaping the shell would expand the `*`, leading to
unexpected behaviour.
  • Loading branch information
timokau committed Jul 15, 2018
1 parent aa6adfc commit 1ddab0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/build-support/fetchpatch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fetchurl ({
--clean "$out" > "$tmpfile"
${patchutils}/bin/filterdiff \
-p1 \
${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \
${builtins.toString (builtins.map (x: "-i ${x}") includes)} \
${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 ""}
'';
Expand Down

0 comments on commit 1ddab0e

Please sign in to comment.