summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2011-08-01 10:57:08 (EDT)
committerTobias Oberlies2011-08-01 12:00:51 (EDT)
commite45af3d34527db9b4dc4d683da5ad5d515aea7b7 (patch)
tree7c3cca15fabbb6acf3d1b9cf16f043d7f22f5d28
parenta43bcda283dc231e7ff05d57e531b7f7f41403ad (diff)
downloadrt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.zip
rt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.tar.gz
rt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.tar.bz2
325611 Publish correctly if action returns a warning
- In case of a warning or info message, the publisher actions are expected to have performed their tasks correctly, and hence the published IUs can be stored in the metadata repository. - This change is a follow-up of bug 325611 and something that will be needed for enhancement 351056.
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java
index 49eeb0c..76df608 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java
@@ -229,7 +229,7 @@ public class Publisher {
IStatus finalStatus = null;
if (info.getArtifactRepository() != null) {
finalStatus = info.getArtifactRepository().executeBatch(artifactProcess, sub);
- if (finalStatus.isOK())
+ if (!finalStatus.matches(IStatus.ERROR | IStatus.CANCEL))
// If the batch process didn't report any errors, then
// Use the status from our actions
finalStatus = artifactProcess.getStatus();
@@ -240,17 +240,24 @@ public class Publisher {
if (Tracing.DEBUG_PUBLISHING)
Tracing.debug("Publishing complete. Result=" + finalStatus); //$NON-NLS-1$
+
+ // if there were no errors, publish all the ius.
+ if (finalStatus.isOK() || finalStatus.matches(IStatus.INFO | IStatus.WARNING))
+ savePublishedIUs();
+
if (!finalStatus.isOK())
return finalStatus;
+ return Status.OK_STATUS;
} finally {
sub.done();
}
- // if there were no errors, publish all the ius.
+ }
+
+ protected void savePublishedIUs() {
IMetadataRepository metadataRepository = info.getMetadataRepository();
if (metadataRepository != null) {
Collection<IInstallableUnit> ius = results.getIUs(null, null);
metadataRepository.addInstallableUnits(ius);
}
- return Status.OK_STATUS;
}
}