Bug 44772 - <patch> task provides no mechanism to fail on error
Summary: <patch> task provides no mechanism to fail on error
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: nightly
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
: 23540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-07 17:24 UTC by Michael Bayne
Modified: 2009-08-17 01:51 UTC (History)
1 user (show)



Attachments
A patch that always fails when the patch command fails. (713 bytes, patch)
2008-04-07 17:24 UTC, Michael Bayne
Details | Diff
A patch that introduces a failOnError attribute to <patch>. (1.61 KB, patch)
2008-04-07 17:25 UTC, Michael Bayne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bayne 2008-04-07 17:24:58 UTC
Created attachment 21787 [details]
A patch that always fails when the patch command fails.

The <patch> task does not fail if the invocation of the patch command fails.

Attached are two patches for <patch>:

1. A patch that simply fails the build when the patch command returns a failure result code. This patch changes the default behavior of patch to fail when the patch command fails, which I think is a good thing but may not be the prevailing wisdom of the Ant project since nearly nothing fails on error by default.

2. A patch that adds a "failOnError" attribute to the <patch> task which defaults to false, but when set to true fails the build when the patch command returns a failure result code.

Actually, it seems that I can only add a single attachment. I will add the first attachment and then hopefully there will be a way to add additional attachments once I file this report.
Comment 1 Michael Bayne 2008-04-07 17:25:38 UTC
Created attachment 21788 [details]
A patch that introduces a failOnError attribute to <patch>.

This and the previous patch are against the 20080407 nightly code snapshot.
Comment 2 Stefan Bodewig 2008-09-16 02:02:06 UTC
svn revision 695779 contains your second patch since backwards compatibility sometimes is more important than having the correct defaults.
Comment 3 Stefan Bodewig 2009-08-17 01:51:38 UTC
*** Bug 23540 has been marked as a duplicate of this bug. ***