Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2011-07-29 10:24:46 -0400
committerTobias Oberlies2011-07-29 11:20:28 -0400
commit34a02349c7893f9d1bda2a0395a8dc144c129e99 (patch)
tree086175d0c16021c02481c53c23170b8af2025dc6 /bundles/org.eclipse.equinox.p2.publisher
parentc5849e4e4b34eb67b11eba909ef2f61c71d30538 (diff)
downloadrt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.tar.gz
rt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.tar.xz
rt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.zip
325611 Publisher app exit code 1 only on error status
With efe8616, the ProductAction returns an INFO status in case of a potential user error. This commit ensures that the status is printed out, but the exit code is still 0 (success).
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
index 6e3385e33..6a52f070d 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
@@ -283,19 +283,21 @@ public abstract class AbstractPublisherApplication implements IApplication {
IStatus result = publisher.publish(actions, new NullProgressMonitor());
long after = System.currentTimeMillis();
- if (result.isOK()) {
+ if (!result.isOK()) {
+ // TODO: improve the string representation of the result
+ System.out.println(result);
+ Throwable th = result.getException();
+ if (th != null) {
+ System.out.println();
+ System.out.println(NLS.bind(Messages.message_resultException, null));
+ th.printStackTrace(System.out);
+ System.out.println();
+ }
+ }
+ if (!result.matches(IStatus.ERROR | IStatus.CANCEL)) {
System.out.println(NLS.bind(Messages.message_generationCompleted, String.valueOf((after - before) / 1000)));
return IApplication.EXIT_OK;
}
- // TODO: improve the string representation of the result
- System.out.println(result);
- Throwable th = result.getException();
- if (th != null) {
- System.out.println();
- System.out.println(NLS.bind(Messages.message_resultException, null));
- th.printStackTrace(System.out);
- System.out.println();
- }
} catch (ProvisionException e) {
status = e.getStatus();
if (status.getSeverity() == IStatus.ERROR && status.getMessage() != null) {

Back to the top