fetchpatch: add excludes parameter

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