fetchpatch: add excludes parameter

+6 -3
+6 -3
pkgs/build-support/fetchpatch/default.nix
··· 5 # stripLen acts as the -p parameter when applying a patch. 6 7 { lib, fetchurl, patchutils }: 8 - { stripLen ? 0, addPrefixes ? false, ... }@args: 9 10 fetchurl ({ 11 postFetch = '' ··· 21 --addnewprefix=b/ \ 22 ''} \ 23 --clean "$out" > "$tmpfile" 24 - mv "$tmpfile" "$out" 25 ${args.postFetch or ""} 26 ''; 27 - } // builtins.removeAttrs args ["stripLen" "addPrefixes"])
··· 5 # stripLen acts as the -p parameter when applying a patch. 6 7 { lib, fetchurl, patchutils }: 8 + { stripLen ? 0, addPrefixes ? false, excludes ? [], ... }@args: 9 10 fetchurl ({ 11 postFetch = '' ··· 21 --addnewprefix=b/ \ 22 ''} \ 23 --clean "$out" > "$tmpfile" 24 + ${patchutils}/bin/filterdiff \ 25 + -p1 \ 26 + ${builtins.toString (builtins.map (x: "-x ${x}") excludes)} \ 27 + "$tmpfile" > "$out" 28 ${args.postFetch or ""} 29 ''; 30 + } // builtins.removeAttrs args ["stripLen" "addPrefixes" "excludes"])