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 125588 Details for
Bug 259598
[repo] repo manager should favor client-settable repo name
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]
Further nickname support
patch.txt (text/plain), 25.18 KB, created by
John Arthorne
on 2009-02-12 17:22:23 EST
(
hide
)
Description:
Further nickname support
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2009-02-12 17:22:23 EST
Size:
25.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java,v >retrieving revision 1.1 >diff -u -r1.1 SiteXMLActionTest.java >--- src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java 12 Dec 2008 21:11:39 -0000 1.1 >+++ src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java 12 Feb 2009 22:21:12 -0000 >@@ -49,6 +49,8 @@ > RepositoryReference ref = (RepositoryReference) it.next(); > assertEquals("1.1", "http://download.eclipse.org/eclipse/updates/3.5", ref.Location.toString()); > assertEquals("1.2", IRepository.ENABLED, ref.Options); >+ assertEquals("1.3", "Eclipse Project Update Site", ref.Nickname); >+ > if (ref.Type == IRepository.TYPE_METADATA) > metadataFound = true; > else if (ref.Type == IRepository.TYPE_ARTIFACT) >Index: src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java,v >retrieving revision 1.16 >diff -u -r1.16 TestMetadataRepository.java >--- src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java 30 Dec 2008 15:58:15 -0000 1.16 >+++ src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java 12 Feb 2009 22:21:12 -0000 >@@ -96,9 +96,9 @@ > this.repositories.addAll(Arrays.asList(state.Repositories)); > } > >- public synchronized void addReference(URI repositoryLocation, int repositoryType, int options) { >+ public synchronized void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) { > assertModifiable(); >- repositories.add(new RepositoryReference(repositoryLocation, repositoryType, options)); >+ repositories.add(new RepositoryReference(repositoryLocation, nickname, repositoryType, options)); > } > > /** >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java,v >retrieving revision 1.18 >diff -u -r1.18 LocalMetadataRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java 24 Jan 2009 20:35:14 -0000 1.18 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java 12 Feb 2009 22:21:12 -0000 >@@ -12,7 +12,6 @@ > package org.eclipse.equinox.p2.tests.metadata.repository; > > import java.io.File; >-import java.net.MalformedURLException; > import java.net.URI; > import java.util.*; > import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; >@@ -52,7 +51,7 @@ > super.tearDown(); > } > >- public void testCompressedRepository() throws MalformedURLException, ProvisionException { >+ public void testCompressedRepository() throws ProvisionException { > IMetadataRepositoryManager manager = getMetadataRepositoryManager(); > Map properties = new HashMap(); > properties.put(IRepository.PROP_COMPRESSED, "true"); >@@ -84,7 +83,7 @@ > } > } > >- public void testGetProperties() throws MalformedURLException, ProvisionException { >+ public void testGetProperties() throws ProvisionException { > IMetadataRepositoryManager manager = getMetadataRepositoryManager(); > IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null); > Map properties = repo.getProperties(); >@@ -97,7 +96,7 @@ > } > } > >- public void testSetProperty() throws MalformedURLException, ProvisionException { >+ public void testSetProperty() throws ProvisionException { > IMetadataRepositoryManager manager = getMetadataRepositoryManager(); > IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null); > Map properties = repo.getProperties(); >@@ -149,7 +148,7 @@ > > } > >- public void testUncompressedRepository() throws MalformedURLException, ProvisionException { >+ public void testUncompressedRepository() throws ProvisionException { > IMetadataRepositoryManager manager = getMetadataRepositoryManager(); > Map properties = new HashMap(); > properties.put(IRepository.PROP_COMPRESSED, "false"); >@@ -179,14 +178,14 @@ > * @throws MalformedURLException > * @throws ProvisionException > */ >- public void testLoadSelfReference() throws MalformedURLException, ProvisionException { >+ public void testLoadSelfReference() throws ProvisionException { > //setup a repository that has a reference to itself in disabled state > IMetadataRepositoryManager manager = getMetadataRepositoryManager(); > Map properties = new HashMap(); > properties.put(IRepository.PROP_COMPRESSED, "false"); > final URI repoURI = repoLocation.toURI(); > IMetadataRepository repo = manager.createRepository(repoURI, "testLoadSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties); >- repo.addReference(repoURI, IRepository.TYPE_METADATA, IRepository.NONE); >+ repo.addReference(repoURI, "testNick", IRepository.TYPE_METADATA, IRepository.NONE); > //adding a reference doesn't save the repository, but setting a property does > repo.setProperty("changed", "false"); > >@@ -226,7 +225,7 @@ > properties.put(IRepository.PROP_COMPRESSED, "false"); > final URI repoURL = repoLocation.toURI(); > IMetadataRepository repo = manager.createRepository(repoURL, "testRefreshSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties); >- repo.addReference(repoURL, IRepository.TYPE_METADATA, IRepository.NONE); >+ repo.addReference(repoURL, "testNick", IRepository.TYPE_METADATA, IRepository.NONE); > //adding a reference doesn't save the repository, but setting a property does > repo.setProperty("changed", "false"); > >#P org.eclipse.equinox.p2.updatesite >Index: src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java,v >retrieving revision 1.38 >diff -u -r1.38 UpdateSiteMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java 27 Oct 2008 18:51:18 -0000 1.38 >+++ src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java 12 Feb 2009 22:21:13 -0000 >@@ -35,7 +35,7 @@ > throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$ > } > >- public void addReference(URI location, int type, int options) { >+ public void addReference(URI location, String nickname, int type, int options) { > throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$ > } > >Index: src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java,v >retrieving revision 1.15 >diff -u -r1.15 SiteXMLAction.java >--- src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 11 Feb 2009 19:01:53 -0000 1.15 >+++ src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 12 Feb 2009 22:21:13 -0000 >@@ -176,7 +176,7 @@ > URLEntry[] associatedSites = site.getAssociatedSites(); > if (associatedSites != null) > for (int i = 0; i < associatedSites.length; i++) >- generateSiteReference(associatedSites[i].getURL(), null, info.getMetadataRepository()); >+ generateSiteReference(associatedSites[i].getURL(), associatedSites[i].getAnnotation(), null, info.getMetadataRepository()); > > File siteFile = URIUtil.toFile(updateSite.getLocation()); > if (siteFile != null && siteFile.exists()) { >@@ -209,16 +209,17 @@ > /** > * Generates and publishes a reference to an update site location > * @param location The update site location >+ * @param label The update site label > * @param featureId the identifier of the feature where the error occurred, or null > * @param metadataRepo The repository into which the references are added > */ >- private void generateSiteReference(String location, String featureId, IMetadataRepository metadataRepo) { >+ private void generateSiteReference(String location, String label, String featureId, IMetadataRepository metadataRepo) { > if (metadataRepo == null) > return; > try { > URI associateLocation = new URI(location); >- metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, IRepository.ENABLED); >- metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, IRepository.ENABLED); >+ metadataRepo.addReference(associateLocation, label, IRepository.TYPE_METADATA, IRepository.ENABLED); >+ metadataRepo.addReference(associateLocation, label, IRepository.TYPE_ARTIFACT, IRepository.ENABLED); > } catch (URISyntaxException e) { > String message = "Invalid site reference: " + location; //$NON-NLS-1$ > if (featureId != null) >#P org.eclipse.equinox.p2.metadata.generator >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java,v >retrieving revision 1.78 >diff -u -r1.78 Generator.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 23 Jan 2009 20:23:00 -0000 1.78 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 12 Feb 2009 22:21:13 -0000 >@@ -988,14 +988,14 @@ > for (int i = 0; i < features.length; i++) { > Feature feature = features[i]; > //publish feature site references >- String updateURL = feature.getUpdateSiteURL(); >+ URLEntry updateURL = feature.getUpdateSite(); > //don't enable feature update sites by default since this results in too many > //extra sites being loaded and searched (Bug 234177) > if (updateURL != null) >- generateSiteReference(updateURL, feature.getId(), false); >+ generateSiteReference(updateURL.getURL(), updateURL.getAnnotation(), feature.getId(), false); > URLEntry[] discoverySites = feature.getDiscoverySites(); > for (int j = 0; j < discoverySites.length; j++) >- generateSiteReference(discoverySites[j].getURL(), feature.getId(), false); >+ generateSiteReference(discoverySites[j].getURL(), discoverySites[j].getAnnotation(), feature.getId(), false); > > //generate feature IU > String location = feature.getLocation(); >@@ -1108,13 +1108,13 @@ > * @param isEnabled Whether the site should be enabled by default > * @deprecated moved to FeaturesAction > */ >- private void generateSiteReference(String location, String featureId, boolean isEnabled) { >+ private void generateSiteReference(String location, String name, String featureId, boolean isEnabled) { > IMetadataRepository metadataRepo = info.getMetadataRepository(); > try { > URI associateLocation = URIUtil.fromString(location); > int flags = isEnabled ? IRepository.ENABLED : IRepository.NONE; >- metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, flags); >- metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, flags); >+ metadataRepo.addReference(associateLocation, name, IRepository.TYPE_METADATA, flags); >+ metadataRepo.addReference(associateLocation, name, IRepository.TYPE_ARTIFACT, flags); > } catch (URISyntaxException e) { > String message = "Invalid site reference: " + location; //$NON-NLS-1$ > if (featureId != null) >@@ -1251,7 +1251,7 @@ > URLEntry[] associatedSites = site.getAssociatedSites(); > if (associatedSites != null) > for (int i = 0; i < associatedSites.length; i++) >- generateSiteReference(associatedSites[i].getURL(), null, true); >+ generateSiteReference(associatedSites[i].getURL(), associatedSites[i].getAnnotation(), null, true); > > if (PROTOCOL_FILE.equals(siteLocation.getScheme())) { > File siteFile = URIUtil.toFile(siteLocation); >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java,v >retrieving revision 1.5 >diff -u -r1.5 Feature.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java 7 Nov 2008 20:30:35 -0000 1.5 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java 12 Feb 2009 22:21:13 -0000 >@@ -157,10 +157,8 @@ > return providerName; > } > >- public String getUpdateSiteURL() { >- if (updateSite != null) >- return updateSite.getURL(); >- return null; >+ public URLEntry getUpdateSite() { >+ return updateSite; > } > > public String getVersion() { >#P org.eclipse.equinox.p2.core >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java,v >retrieving revision 1.6 >diff -u -r1.6 RepositoryEvent.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java 20 Oct 2008 19:24:31 -0000 1.6 >+++ src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java 12 Feb 2009 22:21:14 -0000 >@@ -59,8 +59,23 @@ > public static final int ENABLEMENT = 8; > > private final int kind, type; >- > private boolean isEnabled; >+ private String nickname; >+ >+ /** >+ * Creates and returns a new repository discovery event. >+ * @param location the location of the repository that changed. >+ * @param nickname the repository nickname >+ * @param repositoryType the type of repository that was changed >+ * @param enabled whether the repository is enabled >+ * @return A new repository discovery event >+ * @see IRepository#PROP_NICKNAME >+ */ >+ public static RepositoryEvent newDiscoveryEvent(URI location, String nickname, int repositoryType, boolean enabled) { >+ RepositoryEvent event = new RepositoryEvent(location, repositoryType, DISCOVERED, enabled); >+ event.nickname = nickname; >+ return event; >+ } > > /** > * Creates a new repository event. >@@ -92,6 +107,15 @@ > } > > /** >+ * Returns the nickname of the repository. This method is only applicable >+ * for the {@link #DISCOVERED} event type. For other event types this >+ * method returns <code>null</code>. >+ */ >+ public String getRepositoryNickname() { >+ return nickname; >+ } >+ >+ /** > * Returns the location of the repository associated with this event. > * > * @return the location of the repository associated with this event. >#P org.eclipse.equinox.p2.metadata.repository >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java,v >retrieving revision 1.10 >diff -u -r1.10 AbstractMetadataRepository.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java 30 Dec 2008 15:57:49 -0000 1.10 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java 12 Feb 2009 22:21:14 -0000 >@@ -55,7 +55,7 @@ > assertModifiable(); > } > >- public void addReference(URI repositoryLocation, int repositoryType, int options) { >+ public void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) { > assertModifiable(); > } > >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/RepositoryReference.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/RepositoryReference.java,v >retrieving revision 1.2 >diff -u -r1.2 RepositoryReference.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/RepositoryReference.java 9 Oct 2008 03:21:52 -0000 1.2 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/RepositoryReference.java 12 Feb 2009 22:21:14 -0000 >@@ -19,11 +19,13 @@ > public URI Location; > public int Type; > public int Options; >+ public String Nickname; > >- public RepositoryReference(URI location, int type, int options) { >+ public RepositoryReference(URI location, String nickname, int type, int options) { > this.Location = location; > this.Type = type; > this.Options = options; >+ this.Nickname = nickname; > } > > public boolean equals(Object obj) { >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java,v >retrieving revision 1.30 >diff -u -r1.30 MetadataParser.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java 23 Jan 2009 01:48:14 -0000 1.30 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java 12 Feb 2009 22:21:14 -0000 >@@ -61,11 +61,12 @@ > public RepositoryReferenceHandler(AbstractHandler parentHandler, Attributes attributes, Set references) { > super(parentHandler, REPOSITORY_REFERENCE_ELEMENT); > String[] values = parseRequiredAttributes(attributes, required); >+ String name = parseOptionalAttribute(attributes, NAME_ATTRIBUTE); > int type = checkInteger(elementHandled, TYPE_ATTRIBUTE, values[0]); > int options = checkInteger(elementHandled, OPTIONS_ATTRIBUTE, values[1]); > URI location = parseURIAttribute(attributes, true); > if (location != null) >- references.add(new RepositoryReference(location, type, options)); >+ references.add(new RepositoryReference(location, name, type, options)); > } > > public void startElement(String name, Attributes attributes) { >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java,v >retrieving revision 1.33 >diff -u -r1.33 LocalMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java 24 Jan 2009 20:35:13 -0000 1.33 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java 12 Feb 2009 22:21:14 -0000 >@@ -92,9 +92,9 @@ > save(); > } > >- public synchronized void addReference(URI repositoryLocation, int repositoryType, int options) { >+ public synchronized void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) { > assertModifiable(); >- repositories.add(new RepositoryReference(repositoryLocation, repositoryType, options)); >+ repositories.add(new RepositoryReference(repositoryLocation, nickname, repositoryType, options)); > } > > public void initialize(RepositoryState state) { >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java,v >retrieving revision 1.4 >diff -u -r1.4 IMetadataRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java 9 Oct 2008 03:21:52 -0000 1.4 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java 12 Feb 2009 22:21:14 -0000 >@@ -50,13 +50,14 @@ > * be marked as disabled. > * > * @param location the location of the repository to add >+ * @param nickname The nickname of the repository, or <code>null</code> > * @param type the repository type (currently either {@link IRepository#TYPE_METADATA} > * or {@link IRepository#TYPE_ARTIFACT}). > * @param options bit-wise or of option constants (currently either > * {@link IRepository#ENABLED} or {@link IRepository#NONE}). > * @see IMetadataRepositoryManager#setEnabled(URI, boolean) > */ >- public void addReference(URI location, int type, int options); >+ public void addReference(URI location, String nickname, int type, int options); > > /** > * Removes all installable units that match the given query from this repository. >#P org.eclipse.equinox.p2.publisher >Index: src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java,v >retrieving revision 1.28 >diff -u -r1.28 FeaturesAction.java >--- src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java 11 Feb 2009 16:25:48 -0000 1.28 >+++ src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java 12 Feb 2009 22:21:15 -0000 >@@ -468,14 +468,15 @@ > /** > * Generates and publishes a reference to an update site location > * @param location The update site location >+ * @param nickname The update site label > * @param featureId the identifier of the feature where the error occurred, or null > * @param metadataRepo The repo into which the references are added > */ >- private void generateSiteReference(String location, String featureId, IMetadataRepository metadataRepo) { >+ private void generateSiteReference(String location, String nickname, String featureId, IMetadataRepository metadataRepo) { > try { > URI associateLocation = new URI(location); >- metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, IRepository.NONE); >- metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, IRepository.NONE); >+ metadataRepo.addReference(associateLocation, nickname, IRepository.TYPE_METADATA, IRepository.NONE); >+ metadataRepo.addReference(associateLocation, nickname, IRepository.TYPE_ARTIFACT, IRepository.NONE); > } catch (URISyntaxException e) { > String message = "Invalid site reference: " + location; //$NON-NLS-1$ > if (featureId != null) >@@ -486,14 +487,14 @@ > > private void generateSiteReferences(Feature feature, IPublisherResult result, IPublisherInfo info) { > //publish feature site references >- String updateURL = feature.getUpdateSiteURL(); >+ URLEntry updateURL = feature.getUpdateSite(); > //don't enable feature update sites by default since this results in too many > //extra sites being loaded and searched (Bug 234177) > if (updateURL != null) >- generateSiteReference(updateURL, feature.getId(), info.getMetadataRepository()); >+ generateSiteReference(updateURL.getURL(), updateURL.getAnnotation(), feature.getId(), info.getMetadataRepository()); > URLEntry[] discoverySites = feature.getDiscoverySites(); >- for (int j = 0; j < discoverySites.length; j++) >- generateSiteReference(discoverySites[j].getURL(), feature.getId(), info.getMetadataRepository()); >+ for (int i = 0; i < discoverySites.length; i++) >+ generateSiteReference(discoverySites[i].getURL(), discoverySites[i].getAnnotation(), feature.getId(), info.getMetadataRepository()); > } > > protected Feature[] getFeatures(File[] locations) { >Index: src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java,v >retrieving revision 1.1 >diff -u -r1.1 Feature.java >--- src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java 19 Jul 2008 12:18:23 -0000 1.1 >+++ src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java 12 Feb 2009 22:21:15 -0000 >@@ -183,16 +183,8 @@ > return providerName; > } > >- public String getUpdateSiteLabel() { >- if (updateSite != null) >- return updateSite.getAnnotation(); >- return null; >- } >- >- public String getUpdateSiteURL() { >- if (updateSite != null) >- return updateSite.getURL(); >- return null; >+ public URLEntry getUpdateSite() { >+ return updateSite; > } > > public String getVersion() {
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 259598
:
125547
| 125588