Summary: | Optional RPM task succeeds even if RPM process fails | ||
---|---|---|---|
Product: | Ant | Reporter: | Julian Simpson <julian.simpson> |
Component: | Optional Tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | ErrorMessage |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Attachments: |
Proposed patch to close this bug - examines exit code and throws buildException when neccessary.
proposed patch - context diff Unit Test for bug fix. Context Diff patch for Rpm.java |
Description
Julian Simpson
2005-01-24 16:25:58 UTC
Created attachment 14088 [details]
Proposed patch to close this bug - examines exit code and throws buildException when neccessary.
I tested this under debian testing with a build of Ant from yesterday. When
rpmbuild doesn't exit cleanly, the build fails. When rpmbuild does exit
cleanly, the build succeeds.
Created attachment 14150 [details]
proposed patch - context diff
sorry, forgot to do context diff - here it is.
Fixed in CVS. Please test. Better yet. please can you give us a unit test? Created attachment 14273 [details]
Unit Test for bug fix.
This is the unit test for the bug. I had to change the code under test
slightly so I could return the correct value without actually trying to execute
something. That would have slowed the test down. I extracted a private method
out of the big "execute" method in Rpm.java and overrode that. A context diff
for Rpm.java follows this attachment.
Created attachment 14274 [details]
Context Diff patch for Rpm.java
This is a non-functional change to the class - I just pulled some of the
execute method into a private method so as to make the code more testable.
(In reply to comment #3) > Fixed in CVS. Please test. Better yet. please can you give us a unit test? Thanks. Unit test supplied as requested. J. I've committed a modified version of the test, thanks. Modified since we've now added a failonerror attribute to <rpm> (with default false for backwards compatibility) and I've used the test as a basis to check both states of this attribute. |