Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 259598 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java (+2 lines)
Lines 49-54 Link Here
49
			RepositoryReference ref = (RepositoryReference) it.next();
49
			RepositoryReference ref = (RepositoryReference) it.next();
50
			assertEquals("1.1", "http://download.eclipse.org/eclipse/updates/3.5", ref.Location.toString());
50
			assertEquals("1.1", "http://download.eclipse.org/eclipse/updates/3.5", ref.Location.toString());
51
			assertEquals("1.2", IRepository.ENABLED, ref.Options);
51
			assertEquals("1.2", IRepository.ENABLED, ref.Options);
52
			assertEquals("1.3", "Eclipse Project Update Site", ref.Nickname);
53
52
			if (ref.Type == IRepository.TYPE_METADATA)
54
			if (ref.Type == IRepository.TYPE_METADATA)
53
				metadataFound = true;
55
				metadataFound = true;
54
			else if (ref.Type == IRepository.TYPE_ARTIFACT)
56
			else if (ref.Type == IRepository.TYPE_ARTIFACT)
(-)src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java (-2 / +2 lines)
Lines 96-104 Link Here
96
		this.repositories.addAll(Arrays.asList(state.Repositories));
96
		this.repositories.addAll(Arrays.asList(state.Repositories));
97
	}
97
	}
98
98
99
	public synchronized void addReference(URI repositoryLocation, int repositoryType, int options) {
99
	public synchronized void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) {
100
		assertModifiable();
100
		assertModifiable();
101
		repositories.add(new RepositoryReference(repositoryLocation, repositoryType, options));
101
		repositories.add(new RepositoryReference(repositoryLocation, nickname, repositoryType, options));
102
	}
102
	}
103
103
104
	/**
104
	/**
(-)src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java (-8 / +7 lines)
Lines 12-18 Link Here
12
package org.eclipse.equinox.p2.tests.metadata.repository;
12
package org.eclipse.equinox.p2.tests.metadata.repository;
13
13
14
import java.io.File;
14
import java.io.File;
15
import java.net.MalformedURLException;
16
import java.net.URI;
15
import java.net.URI;
17
import java.util.*;
16
import java.util.*;
18
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
17
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
Lines 52-58 Link Here
52
		super.tearDown();
51
		super.tearDown();
53
	}
52
	}
54
53
55
	public void testCompressedRepository() throws MalformedURLException, ProvisionException {
54
	public void testCompressedRepository() throws ProvisionException {
56
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
55
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
57
		Map properties = new HashMap();
56
		Map properties = new HashMap();
58
		properties.put(IRepository.PROP_COMPRESSED, "true");
57
		properties.put(IRepository.PROP_COMPRESSED, "true");
Lines 84-90 Link Here
84
		}
83
		}
85
	}
84
	}
86
85
87
	public void testGetProperties() throws MalformedURLException, ProvisionException {
86
	public void testGetProperties() throws ProvisionException {
88
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
87
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
89
		IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
88
		IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
90
		Map properties = repo.getProperties();
89
		Map properties = repo.getProperties();
Lines 97-103 Link Here
97
		}
96
		}
98
	}
97
	}
99
98
100
	public void testSetProperty() throws MalformedURLException, ProvisionException {
99
	public void testSetProperty() throws ProvisionException {
101
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
100
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
102
		IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
101
		IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
103
		Map properties = repo.getProperties();
102
		Map properties = repo.getProperties();
Lines 149-155 Link Here
149
148
150
	}
149
	}
151
150
152
	public void testUncompressedRepository() throws MalformedURLException, ProvisionException {
151
	public void testUncompressedRepository() throws ProvisionException {
153
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
152
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
154
		Map properties = new HashMap();
153
		Map properties = new HashMap();
155
		properties.put(IRepository.PROP_COMPRESSED, "false");
154
		properties.put(IRepository.PROP_COMPRESSED, "false");
Lines 179-192 Link Here
179
	 * @throws MalformedURLException 
178
	 * @throws MalformedURLException 
180
	 * @throws ProvisionException 
179
	 * @throws ProvisionException 
181
	 */
180
	 */
182
	public void testLoadSelfReference() throws MalformedURLException, ProvisionException {
181
	public void testLoadSelfReference() throws ProvisionException {
183
		//setup a repository that has a reference to itself in disabled state
182
		//setup a repository that has a reference to itself in disabled state
184
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
183
		IMetadataRepositoryManager manager = getMetadataRepositoryManager();
185
		Map properties = new HashMap();
184
		Map properties = new HashMap();
186
		properties.put(IRepository.PROP_COMPRESSED, "false");
185
		properties.put(IRepository.PROP_COMPRESSED, "false");
187
		final URI repoURI = repoLocation.toURI();
186
		final URI repoURI = repoLocation.toURI();
188
		IMetadataRepository repo = manager.createRepository(repoURI, "testLoadSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
187
		IMetadataRepository repo = manager.createRepository(repoURI, "testLoadSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
189
		repo.addReference(repoURI, IRepository.TYPE_METADATA, IRepository.NONE);
188
		repo.addReference(repoURI, "testNick", IRepository.TYPE_METADATA, IRepository.NONE);
190
		//adding a reference doesn't save the repository, but setting a property does
189
		//adding a reference doesn't save the repository, but setting a property does
191
		repo.setProperty("changed", "false");
190
		repo.setProperty("changed", "false");
192
191
Lines 226-232 Link Here
226
		properties.put(IRepository.PROP_COMPRESSED, "false");
225
		properties.put(IRepository.PROP_COMPRESSED, "false");
227
		final URI repoURL = repoLocation.toURI();
226
		final URI repoURL = repoLocation.toURI();
228
		IMetadataRepository repo = manager.createRepository(repoURL, "testRefreshSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
227
		IMetadataRepository repo = manager.createRepository(repoURL, "testRefreshSelfReference", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
229
		repo.addReference(repoURL, IRepository.TYPE_METADATA, IRepository.NONE);
228
		repo.addReference(repoURL, "testNick", IRepository.TYPE_METADATA, IRepository.NONE);
230
		//adding a reference doesn't save the repository, but setting a property does
229
		//adding a reference doesn't save the repository, but setting a property does
231
		repo.setProperty("changed", "false");
230
		repo.setProperty("changed", "false");
232
231
(-)src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java (-1 / +1 lines)
Lines 35-41 Link Here
35
		throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
35
		throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
36
	}
36
	}
37
37
38
	public void addReference(URI location, int type, int options) {
38
	public void addReference(URI location, String nickname, int type, int options) {
39
		throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
39
		throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
40
	}
40
	}
41
41
(-)src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java (-4 / +5 lines)
Lines 176-182 Link Here
176
		URLEntry[] associatedSites = site.getAssociatedSites();
176
		URLEntry[] associatedSites = site.getAssociatedSites();
177
		if (associatedSites != null)
177
		if (associatedSites != null)
178
			for (int i = 0; i < associatedSites.length; i++)
178
			for (int i = 0; i < associatedSites.length; i++)
179
				generateSiteReference(associatedSites[i].getURL(), null, info.getMetadataRepository());
179
				generateSiteReference(associatedSites[i].getURL(), associatedSites[i].getAnnotation(), null, info.getMetadataRepository());
180
180
181
		File siteFile = URIUtil.toFile(updateSite.getLocation());
181
		File siteFile = URIUtil.toFile(updateSite.getLocation());
182
		if (siteFile != null && siteFile.exists()) {
182
		if (siteFile != null && siteFile.exists()) {
Lines 209-224 Link Here
209
	/**
209
	/**
210
	 * Generates and publishes a reference to an update site location
210
	 * Generates and publishes a reference to an update site location
211
	 * @param location The update site location
211
	 * @param location The update site location
212
	 * @param label The update site label
212
	 * @param featureId the identifier of the feature where the error occurred, or null
213
	 * @param featureId the identifier of the feature where the error occurred, or null
213
	 * @param metadataRepo The repository into which the references are added
214
	 * @param metadataRepo The repository into which the references are added
214
	 */
215
	 */
215
	private void generateSiteReference(String location, String featureId, IMetadataRepository metadataRepo) {
216
	private void generateSiteReference(String location, String label, String featureId, IMetadataRepository metadataRepo) {
216
		if (metadataRepo == null)
217
		if (metadataRepo == null)
217
			return;
218
			return;
218
		try {
219
		try {
219
			URI associateLocation = new URI(location);
220
			URI associateLocation = new URI(location);
220
			metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, IRepository.ENABLED);
221
			metadataRepo.addReference(associateLocation, label, IRepository.TYPE_METADATA, IRepository.ENABLED);
221
			metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, IRepository.ENABLED);
222
			metadataRepo.addReference(associateLocation, label, IRepository.TYPE_ARTIFACT, IRepository.ENABLED);
222
		} catch (URISyntaxException e) {
223
		} catch (URISyntaxException e) {
223
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
224
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
224
			if (featureId != null)
225
			if (featureId != null)
(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java (-7 / +7 lines)
Lines 988-1001 Link Here
988
		for (int i = 0; i < features.length; i++) {
988
		for (int i = 0; i < features.length; i++) {
989
			Feature feature = features[i];
989
			Feature feature = features[i];
990
			//publish feature site references
990
			//publish feature site references
991
			String updateURL = feature.getUpdateSiteURL();
991
			URLEntry updateURL = feature.getUpdateSite();
992
			//don't enable feature update sites by default since this results in too many
992
			//don't enable feature update sites by default since this results in too many
993
			//extra sites being loaded and searched (Bug 234177)
993
			//extra sites being loaded and searched (Bug 234177)
994
			if (updateURL != null)
994
			if (updateURL != null)
995
				generateSiteReference(updateURL, feature.getId(), false);
995
				generateSiteReference(updateURL.getURL(), updateURL.getAnnotation(), feature.getId(), false);
996
			URLEntry[] discoverySites = feature.getDiscoverySites();
996
			URLEntry[] discoverySites = feature.getDiscoverySites();
997
			for (int j = 0; j < discoverySites.length; j++)
997
			for (int j = 0; j < discoverySites.length; j++)
998
				generateSiteReference(discoverySites[j].getURL(), feature.getId(), false);
998
				generateSiteReference(discoverySites[j].getURL(), discoverySites[j].getAnnotation(), feature.getId(), false);
999
999
1000
			//generate feature IU
1000
			//generate feature IU
1001
			String location = feature.getLocation();
1001
			String location = feature.getLocation();
Lines 1108-1120 Link Here
1108
	 * @param isEnabled Whether the site should be enabled by default
1108
	 * @param isEnabled Whether the site should be enabled by default
1109
	 * @deprecated moved to FeaturesAction
1109
	 * @deprecated moved to FeaturesAction
1110
	 */
1110
	 */
1111
	private void generateSiteReference(String location, String featureId, boolean isEnabled) {
1111
	private void generateSiteReference(String location, String name, String featureId, boolean isEnabled) {
1112
		IMetadataRepository metadataRepo = info.getMetadataRepository();
1112
		IMetadataRepository metadataRepo = info.getMetadataRepository();
1113
		try {
1113
		try {
1114
			URI associateLocation = URIUtil.fromString(location);
1114
			URI associateLocation = URIUtil.fromString(location);
1115
			int flags = isEnabled ? IRepository.ENABLED : IRepository.NONE;
1115
			int flags = isEnabled ? IRepository.ENABLED : IRepository.NONE;
1116
			metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, flags);
1116
			metadataRepo.addReference(associateLocation, name, IRepository.TYPE_METADATA, flags);
1117
			metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, flags);
1117
			metadataRepo.addReference(associateLocation, name, IRepository.TYPE_ARTIFACT, flags);
1118
		} catch (URISyntaxException e) {
1118
		} catch (URISyntaxException e) {
1119
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
1119
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
1120
			if (featureId != null)
1120
			if (featureId != null)
Lines 1251-1257 Link Here
1251
		URLEntry[] associatedSites = site.getAssociatedSites();
1251
		URLEntry[] associatedSites = site.getAssociatedSites();
1252
		if (associatedSites != null)
1252
		if (associatedSites != null)
1253
			for (int i = 0; i < associatedSites.length; i++)
1253
			for (int i = 0; i < associatedSites.length; i++)
1254
				generateSiteReference(associatedSites[i].getURL(), null, true);
1254
				generateSiteReference(associatedSites[i].getURL(), associatedSites[i].getAnnotation(), null, true);
1255
1255
1256
		if (PROTOCOL_FILE.equals(siteLocation.getScheme())) {
1256
		if (PROTOCOL_FILE.equals(siteLocation.getScheme())) {
1257
			File siteFile = URIUtil.toFile(siteLocation);
1257
			File siteFile = URIUtil.toFile(siteLocation);
(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java (-4 / +2 lines)
Lines 157-166 Link Here
157
		return providerName;
157
		return providerName;
158
	}
158
	}
159
159
160
	public String getUpdateSiteURL() {
160
	public URLEntry getUpdateSite() {
161
		if (updateSite != null)
161
		return updateSite;
162
			return updateSite.getURL();
163
		return null;
164
	}
162
	}
165
163
166
	public String getVersion() {
164
	public String getVersion() {
(-)src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java (-1 / +25 lines)
Lines 59-66 Link Here
59
	public static final int ENABLEMENT = 8;
59
	public static final int ENABLEMENT = 8;
60
60
61
	private final int kind, type;
61
	private final int kind, type;
62
63
	private boolean isEnabled;
62
	private boolean isEnabled;
63
	private String nickname;
64
65
	/**
66
	 * Creates and returns a new repository discovery event.
67
	 * @param location the location of the repository that changed.
68
	 * @param nickname the repository nickname
69
	 * @param repositoryType the type of repository that was changed
70
	 * @param enabled whether the repository is enabled
71
	 * @return A new repository discovery event
72
	 * @see IRepository#PROP_NICKNAME
73
	 */
74
	public static RepositoryEvent newDiscoveryEvent(URI location, String nickname, int repositoryType, boolean enabled) {
75
		RepositoryEvent event = new RepositoryEvent(location, repositoryType, DISCOVERED, enabled);
76
		event.nickname = nickname;
77
		return event;
78
	}
64
79
65
	/**
80
	/**
66
	 * Creates a new repository event.
81
	 * Creates a new repository event.
Lines 92-97 Link Here
92
	}
107
	}
93
108
94
	/**
109
	/**
110
	 * Returns the nickname of the repository. This method is only applicable
111
	 * for the {@link #DISCOVERED} event type. For other event types this
112
	 * method returns <code>null</code>.
113
	 */
114
	public String getRepositoryNickname() {
115
		return nickname;
116
	}
117
118
	/**
95
	 * Returns the location of the repository associated with this event.
119
	 * Returns the location of the repository associated with this event.
96
	 * 
120
	 * 
97
	 * @return the location of the repository associated with this event.
121
	 * @return the location of the repository associated with this event.
(-)src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java (-1 / +1 lines)
Lines 55-61 Link Here
55
		assertModifiable();
55
		assertModifiable();
56
	}
56
	}
57
57
58
	public void addReference(URI repositoryLocation, int repositoryType, int options) {
58
	public void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) {
59
		assertModifiable();
59
		assertModifiable();
60
	}
60
	}
61
61
(-)src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/RepositoryReference.java (-1 / +3 lines)
Lines 19-29 Link Here
19
	public URI Location;
19
	public URI Location;
20
	public int Type;
20
	public int Type;
21
	public int Options;
21
	public int Options;
22
	public String Nickname;
22
23
23
	public RepositoryReference(URI location, int type, int options) {
24
	public RepositoryReference(URI location, String nickname, int type, int options) {
24
		this.Location = location;
25
		this.Location = location;
25
		this.Type = type;
26
		this.Type = type;
26
		this.Options = options;
27
		this.Options = options;
28
		this.Nickname = nickname;
27
	}
29
	}
28
30
29
	public boolean equals(Object obj) {
31
	public boolean equals(Object obj) {
(-)src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java (-1 / +2 lines)
Lines 61-71 Link Here
61
		public RepositoryReferenceHandler(AbstractHandler parentHandler, Attributes attributes, Set references) {
61
		public RepositoryReferenceHandler(AbstractHandler parentHandler, Attributes attributes, Set references) {
62
			super(parentHandler, REPOSITORY_REFERENCE_ELEMENT);
62
			super(parentHandler, REPOSITORY_REFERENCE_ELEMENT);
63
			String[] values = parseRequiredAttributes(attributes, required);
63
			String[] values = parseRequiredAttributes(attributes, required);
64
			String name = parseOptionalAttribute(attributes, NAME_ATTRIBUTE);
64
			int type = checkInteger(elementHandled, TYPE_ATTRIBUTE, values[0]);
65
			int type = checkInteger(elementHandled, TYPE_ATTRIBUTE, values[0]);
65
			int options = checkInteger(elementHandled, OPTIONS_ATTRIBUTE, values[1]);
66
			int options = checkInteger(elementHandled, OPTIONS_ATTRIBUTE, values[1]);
66
			URI location = parseURIAttribute(attributes, true);
67
			URI location = parseURIAttribute(attributes, true);
67
			if (location != null)
68
			if (location != null)
68
				references.add(new RepositoryReference(location, type, options));
69
				references.add(new RepositoryReference(location, name, type, options));
69
		}
70
		}
70
71
71
		public void startElement(String name, Attributes attributes) {
72
		public void startElement(String name, Attributes attributes) {
(-)src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java (-2 / +2 lines)
Lines 92-100 Link Here
92
		save();
92
		save();
93
	}
93
	}
94
94
95
	public synchronized void addReference(URI repositoryLocation, int repositoryType, int options) {
95
	public synchronized void addReference(URI repositoryLocation, String nickname, int repositoryType, int options) {
96
		assertModifiable();
96
		assertModifiable();
97
		repositories.add(new RepositoryReference(repositoryLocation, repositoryType, options));
97
		repositories.add(new RepositoryReference(repositoryLocation, nickname, repositoryType, options));
98
	}
98
	}
99
99
100
	public void initialize(RepositoryState state) {
100
	public void initialize(RepositoryState state) {
(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java (-1 / +2 lines)
Lines 50-62 Link Here
50
	 * be marked as disabled.
50
	 * be marked as disabled.
51
	 * 
51
	 * 
52
	 * @param location the location of the repository to add
52
	 * @param location the location of the repository to add
53
	 * @param nickname The nickname of the repository, or <code>null</code>
53
	 * @param type the repository type (currently either {@link IRepository#TYPE_METADATA}
54
	 * @param type the repository type (currently either {@link IRepository#TYPE_METADATA}
54
	 * or {@link IRepository#TYPE_ARTIFACT}).
55
	 * or {@link IRepository#TYPE_ARTIFACT}).
55
	 * @param options bit-wise or of option constants (currently either 
56
	 * @param options bit-wise or of option constants (currently either 
56
	 * {@link IRepository#ENABLED} or {@link IRepository#NONE}).
57
	 * {@link IRepository#ENABLED} or {@link IRepository#NONE}).
57
	 * @see IMetadataRepositoryManager#setEnabled(URI, boolean)
58
	 * @see IMetadataRepositoryManager#setEnabled(URI, boolean)
58
	 */
59
	 */
59
	public void addReference(URI location, int type, int options);
60
	public void addReference(URI location, String nickname, int type, int options);
60
61
61
	/**
62
	/**
62
	 * Removes all installable units that match the given query from this repository.
63
	 * Removes all installable units that match the given query from this repository.
(-)src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java (-7 / +8 lines)
Lines 468-481 Link Here
468
	/**
468
	/**
469
	 * Generates and publishes a reference to an update site location
469
	 * Generates and publishes a reference to an update site location
470
	 * @param location The update site location
470
	 * @param location The update site location
471
	 * @param nickname The update site label
471
	 * @param featureId the identifier of the feature where the error occurred, or null
472
	 * @param featureId the identifier of the feature where the error occurred, or null
472
	 * @param metadataRepo The repo into which the references are added
473
	 * @param metadataRepo The repo into which the references are added
473
	 */
474
	 */
474
	private void generateSiteReference(String location, String featureId, IMetadataRepository metadataRepo) {
475
	private void generateSiteReference(String location, String nickname, String featureId, IMetadataRepository metadataRepo) {
475
		try {
476
		try {
476
			URI associateLocation = new URI(location);
477
			URI associateLocation = new URI(location);
477
			metadataRepo.addReference(associateLocation, IRepository.TYPE_METADATA, IRepository.NONE);
478
			metadataRepo.addReference(associateLocation, nickname, IRepository.TYPE_METADATA, IRepository.NONE);
478
			metadataRepo.addReference(associateLocation, IRepository.TYPE_ARTIFACT, IRepository.NONE);
479
			metadataRepo.addReference(associateLocation, nickname, IRepository.TYPE_ARTIFACT, IRepository.NONE);
479
		} catch (URISyntaxException e) {
480
		} catch (URISyntaxException e) {
480
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
481
			String message = "Invalid site reference: " + location; //$NON-NLS-1$
481
			if (featureId != null)
482
			if (featureId != null)
Lines 486-499 Link Here
486
487
487
	private void generateSiteReferences(Feature feature, IPublisherResult result, IPublisherInfo info) {
488
	private void generateSiteReferences(Feature feature, IPublisherResult result, IPublisherInfo info) {
488
		//publish feature site references
489
		//publish feature site references
489
		String updateURL = feature.getUpdateSiteURL();
490
		URLEntry updateURL = feature.getUpdateSite();
490
		//don't enable feature update sites by default since this results in too many
491
		//don't enable feature update sites by default since this results in too many
491
		//extra sites being loaded and searched (Bug 234177)
492
		//extra sites being loaded and searched (Bug 234177)
492
		if (updateURL != null)
493
		if (updateURL != null)
493
			generateSiteReference(updateURL, feature.getId(), info.getMetadataRepository());
494
			generateSiteReference(updateURL.getURL(), updateURL.getAnnotation(), feature.getId(), info.getMetadataRepository());
494
		URLEntry[] discoverySites = feature.getDiscoverySites();
495
		URLEntry[] discoverySites = feature.getDiscoverySites();
495
		for (int j = 0; j < discoverySites.length; j++)
496
		for (int i = 0; i < discoverySites.length; i++)
496
			generateSiteReference(discoverySites[j].getURL(), feature.getId(), info.getMetadataRepository());
497
			generateSiteReference(discoverySites[i].getURL(), discoverySites[i].getAnnotation(), feature.getId(), info.getMetadataRepository());
497
	}
498
	}
498
499
499
	protected Feature[] getFeatures(File[] locations) {
500
	protected Feature[] getFeatures(File[] locations) {
(-)src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java (-10 / +2 lines)
Lines 183-198 Link Here
183
		return providerName;
183
		return providerName;
184
	}
184
	}
185
185
186
	public String getUpdateSiteLabel() {
186
	public URLEntry getUpdateSite() {
187
		if (updateSite != null)
187
		return updateSite;
188
			return updateSite.getAnnotation();
189
		return null;
190
	}
191
192
	public String getUpdateSiteURL() {
193
		if (updateSite != null)
194
			return updateSite.getURL();
195
		return null;
196
	}
188
	}
197
189
198
	public String getVersion() {
190
	public String getVersion() {

Return to bug 259598