diff options
author | Tobias Oberlies | 2011-08-01 14:57:08 +0000 |
---|---|---|
committer | Tobias Oberlies | 2011-08-01 16:00:51 +0000 |
commit | e45af3d34527db9b4dc4d683da5ad5d515aea7b7 (patch) | |
tree | 7c3cca15fabbb6acf3d1b9cf16f043d7f22f5d28 | |
parent | a43bcda283dc231e7ff05d57e531b7f7f41403ad (diff) | |
download | rt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.tar.gz rt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.tar.xz rt.equinox.p2-e45af3d34527db9b4dc4d683da5ad5d515aea7b7.zip |
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.java | 13 |
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 49eeb0cab..76df6080f 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; } } |