diff options
5 files changed, 15 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/pom.xml b/bundles/org.eclipse.equinox.p2.artifact.repository/pom.xml index 2286f46d0..6737d5a7f 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/pom.xml +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/pom.xml @@ -10,6 +10,6 @@ </parent> <groupId>org.eclipse</groupId> <artifactId>org.eclipse.equinox.p2.artifact.repository</artifactId> - <version>1.1.100-SNAPSHOT</version> + <version>1.1.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java index 68dbd1df1..87cf474b5 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java @@ -378,7 +378,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl current.setBad(true); // If more children are available, set retry if (childIterator.hasNext()) - return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, current.repo.getLocation(), descriptor.getArtifactKey()), null); + return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, descriptor.getArtifactKey(), current.repo.getLocation()), null); // Nothing that can be done, pass child's failure on resetChildFailures(); return status; diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java index da8c1f788..eae97fc3a 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java @@ -52,6 +52,7 @@ public class Messages extends NLS { public static String MirrorLog_Exception_Occurred; public static String MirrorRequest_multipleDownloadProblems; + public static String MirrorRequest_transferFailed; public static String exception_unableToCreateParentDir; diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java index 873c3efd4..b0daef205 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java @@ -179,7 +179,8 @@ public class MirrorRequest extends ArtifactRequest { * @return the status of the transfer operation */ protected IStatus transfer(IArtifactDescriptor destinationDescriptor, IArtifactDescriptor sourceDescriptor, IProgressMonitor monitor) { - IStatus status = Status.OK_STATUS; + MultiStatus allResults = new MultiStatus(Activator.ID, 0, NLS.bind(Messages.MirrorRequest_transferFailed, sourceDescriptor), null); + IStatus lastResult = Status.OK_STATUS; // go until we get one (OK), there are no more mirrors to consider or the operation is cancelled. // Put a hard limit of MAX_RETRY_REQUEST so we don't end up in an infinite loop. // Really, if you've tried MAX_RETRY_REQUEST times without success, it's time to give up @@ -188,11 +189,16 @@ public class MirrorRequest extends ArtifactRequest { int counter = 0; do { - status = transferSingle(destinationDescriptor, sourceDescriptor, monitor); - } while (status.getSeverity() == IStatus.ERROR && status.getCode() == IArtifactRepository.CODE_RETRY && counter++ < MAX_RETRY_REQUEST); - if (status.isOK()) + lastResult = transferSingle(destinationDescriptor, sourceDescriptor, monitor); + allResults.add(lastResult); + } while (lastResult.getSeverity() == IStatus.ERROR && lastResult.getCode() == IArtifactRepository.CODE_RETRY && counter++ < MAX_RETRY_REQUEST); + if (lastResult.isOK()) { collectStats(sourceDescriptor, monitor); - return status; + return lastResult; + } else if (allResults.getChildren().length <= 1) { + return lastResult; + } + return allResults; } /** @@ -247,11 +253,6 @@ public class MirrorRequest extends ArtifactRequest { return new MultiStatus(Activator.ID, status.getCode(), new IStatus[] {status}, NLS.bind(Messages.error_closing_stream, getArtifactKey(), target.getLocation()), e); return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.error_closing_stream, getArtifactKey(), target.getLocation()), e); } - if (status != null && status.getSeverity() == IStatus.ERROR) { - IStatus root = extractRootCause(status); - if (root != null && FileNotFoundException.class == root.getException().getClass()) - return new Status(IStatus.ERROR, Activator.ID, status.getCode(), NLS.bind(Messages.artifact_not_found, getArtifactKey()), root.getException()); - } } return status; } diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties index 9622be281..68453f70a 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties @@ -44,6 +44,7 @@ exception_noComparators = No Artifact Comparators are available. MirrorLog_Console_Log=Logging to the console instead. MirrorLog_Exception_Occurred=An exception occurred while writing to the log: MirrorRequest_multipleDownloadProblems=Multiple problems occurred while downloading. +MirrorRequest_transferFailed=Failed to transfer artifact {0}. exception_unsupportedAddToComposite = Cannot add descriptors to a composite repository. exception_unsupportedGetOutputStream=Cannot write artifacts to a composite repository. |