Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 103991 Details for
Bug 233214
Failing to try mirrors when processing steps reports an error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
cleaned up patch
233214.patch.txt (text/plain), 3.62 KB, created by
Jeff McAffer
on 2008-06-06 13:30:52 EDT
(
hide
)
Description:
cleaned up patch
Filename:
MIME Type:
Creator:
Jeff McAffer
Created:
2008-06-06 13:30:52 EDT
Size:
3.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.artifact.repository >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java,v >retrieving revision 1.58 >diff -u -r1.58 SimpleArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 4 Jun 2008 18:53:13 -0000 1.58 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 6 Jun 2008 17:29:33 -0000 >@@ -396,7 +396,7 @@ > return artifactDescriptors.remove(descriptor); > } > >- protected IStatus downloadArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ private IStatus downloadArtifact(IArtifactDescriptor descriptor, String mirrorLocation, OutputStream destination, IProgressMonitor monitor) { > if (isFolderBased(descriptor)) { > File artifactFolder = getArtifactFile(descriptor); > // TODO: optimize and ensure manifest is written first >@@ -415,9 +415,6 @@ > return Status.OK_STATUS; > } > >- //download from the best available mirror >- String baseLocation = getLocation(descriptor); >- String mirrorLocation = getMirror(baseLocation); > IStatus result = getTransport().download(mirrorLocation, destination, monitor); > if (mirrors != null) > mirrors.reportResult(mirrorLocation, result); >@@ -434,6 +431,23 @@ > return result; > } > >+ protected IStatus downloadArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ String baseLocation = getLocation(descriptor); >+ String mirrorLocation = getMirror(baseLocation); >+ IStatus status = downloadArtifact(descriptor, mirrorLocation, destination, monitor); >+ IStatus result = reportStatus(descriptor, destination, status); >+ // if the original download went reasonably but the reportStatus found some issues >+ // (e..g, in the processing steps/validators) then mark the mirror as bad and return >+ // a retry code (assuming we have more mirrors) >+ if ((status.isOK() || status.matches(IStatus.OK | IStatus.INFO | IStatus.WARNING)) && result.getSeverity() == IStatus.ERROR) { >+ mirrors.reportResult(mirrorLocation, result); >+ if (mirrors != null && mirrors.hasValidMirror()) >+ return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {result}, "Retry another mirror", null); //$NON-NLS-1$ >+ } >+ // if the original status was a retry, don't lose that. >+ return status.getCode() == CODE_RETRY ? status : result; >+ } >+ > /** > * Returns an equivalent mirror location for the given artifact location. > * @param baseLocation The location of the artifact in this repository >@@ -468,14 +482,7 @@ > if (!status.isOK() && status.getSeverity() != IStatus.INFO) > return status; > >- status = downloadArtifact(descriptor, destination, monitor); >- IStatus result = reportStatus(descriptor, destination, status); >- // if the original status was RETRY then ensure that we return that status. It is >- // however important to call reportStatus() either way as it updates information >- // in addition to collecting status. >- // TODO we should remove this when there is more time for testing. >- return status.getCode() == CODE_RETRY ? status : result; >- >+ return downloadArtifact(descriptor, destination, monitor); > } > > public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233214
:
103959
|
103989
|
103991
|
104029