summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2011-07-29 10:24:46 (EDT)
committerTobias Oberlies2011-07-29 11:20:28 (EDT)
commit34a02349c7893f9d1bda2a0395a8dc144c129e99 (patch)
tree086175d0c16021c02481c53c23170b8af2025dc6
parentc5849e4e4b34eb67b11eba909ef2f61c71d30538 (diff)
downloadrt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.zip
rt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.tar.gz
rt.equinox.p2-34a02349c7893f9d1bda2a0395a8dc144c129e99.tar.bz2
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).
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/messages.properties4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/messages.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java22
3 files changed, 14 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/messages.properties b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/messages.properties
index b6dff80..bd388de 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/messages.properties
@@ -21,5 +21,5 @@ exception_invalidProductContentType=Provided value \"{0}\" for product content t
feature_parse_invalidIdOrVersion= Invalid ID \"{0}\" or version \"{1}\" encountered.
feature_parse_emptyRequires = Error parsing feature: \"require\" must include at least one \"import\" element.
-featuresInProductFileIgnored=The product specifies features although useFeatures is false. These features are ignored.
-bundlesInProductFileIgnored=The product specifies bundles although useFeatures is true. These bundles are ignored.
+featuresInProductFileIgnored=The features specified in the product definition are ignored; verify the value of the 'type' or 'useFeatures' attribute.
+bundlesInProductFileIgnored=The bundles specified in the product definition are ignored; verify the value of the 'type' or 'useFeatures' attribute.
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/messages.properties b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/messages.properties
deleted file mode 100644
index e3c5bf7..0000000
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/messages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bundlesInProductFileIgnored=The value of "useFeatures" attribute in .product file is "true" so any bundles and fragments specified in your product are ignored.
-featuresInProductFileIgnored=The value of "useFeatures" attribute in .product file is either "false" or the attribute is missing so any features specified in your product are ignored.
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 6e3385e..6a52f07 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) {