Fix patch such that skipping files does not count as a failure.

Previously, using -S/--skip, -f/--force, or -t/--batch to skip a patch in
a patchset still registers a failure which causes patch to return a
non-zero exit code. This is particularly undesirable with regards to
ports as there is no way to ignore the non-zero code. (Luckily, we don't
currently have any ports that make use of any of these options.)

The PR (yes, my own) is slightly incorrect: It states that -f does indeed
properly skip patches. It does, but it still sets the failure flag causing
patch to return non-zero.

PR:		19638
Submitted by:	kbyanc@posi.net
This commit is contained in:
Kelly Yancey 2000-08-02 06:54:21 +00:00
parent 8eb3acc9be
commit d1b04ce6b7
2 changed files with 1 additions and 2 deletions

View File

@ -313,7 +313,6 @@ char **argv;
newwhere = pch_newfirst() + last_offset;
if (skip_rest_of_patch) {
abort_hunk();
failed++;
if (verbose)
say3("Hunk #%d ignored at %ld.\n", hunk, newwhere);
}

View File

@ -174,7 +174,7 @@ there_is_another_patch()
say3("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s");
skip_to(p_start,p_sline);
while (filearg[0] == Nullch) {
if (force || batch) {
if (force || batch || skip_rest_of_patch) {
say1("No file to patch. Skipping...\n");
filearg[0] = savestr(bestguess);
skip_rest_of_patch = TRUE;