By default. ether patch "FAIL" or "ignored" hunks saved in the same file name. However, In mostly case, We only care "FAIL" hunks from *.rej. The patch can not separate two case(FAIL/Ignored) in different suffix filename.
$ patch --dry-run -p1 -d backports/ --forward -N < kernel_v4.9.patch patching file include/net/cfg80211.h Reversed (or previously applied) patch detected! Skipping patch. 2 out of 2 hunks ignored -- saving rejects to file include/net/cfg80211.h.rej <== both FAIL and ignored hanks saved to *.rej patching file include/uapi/linux/nl80211.h Reversed (or previously applied) patch detected! Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file include/uapi/linux/nl80211.h.rej Sol: I tried rebuild patch-2.7 source. it is what I want. but is any better way here? peter@src$ git diff diff --git a/src/patch.c b/src/patch.c index febfd42..ad9fba8 100644 --- a/src/patch.c +++ b/src/patch.c @@ -586,7 +586,7 @@ main (int argc, char **argv) /* FIXME: This should really be done differently! */ const char *s = simple_backup_suffix; size_t len; - simple_backup_suffix = ".rej"; + simple_backup_suffix = skip_rest_of_patch ? ".ign": ".rej"; rej = find_backup_file_name (outname, simple_backups); len = strlen (rej); if (rej[len - 1] == '~') $ patch-2.7 -p1 -d backports/ --forward -N < kernel_v4.9_patch_for_qcacld2.0.patch Reversed (or previously applied) patch detected! Skipping patch. 2 out of 2 hunks ignored -- saving rejects to file include/net/cfg80211.h.ign patching file include/uapi/linux/nl80211.h Reversed (or previously applied) patch detected! Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file include/uapi/linux/nl80211.h.ign patching file net/mac80211/mlme.c Hunk #1 FAILED at 4486. 1 out of 1 hunk FAILED -- saving rejects to file net/mac80211/mlme.c.rej <== patch FAIL save to *.rej patching file net/wireless/core.h Reversed (or previously applied) patch detected! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file net/wireless/core.h.ign patching file net/wireless/mlme.c Reversed (or previously applied) patch detected! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file net/wireless/mlme.c.ign <== Skip and save to *.ign patching file net/wireless/nl80211.c Regards Peter