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 354260 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java (+1 lines)
Lines 199-208 Link Here
199
		} else {
199
		} else {
200
			writeMatchExpression(singleUD);
200
			writeMatchExpression(singleUD);
201
		}
201
		}
202
		attribute(UPDATE_DESCRIPTOR_SEVERITY, descriptor.getSeverity());
202
		attribute(UPDATE_DESCRIPTOR_SEVERITY, descriptor.getSeverity());
203
		attribute(DESCRIPTION_ATTRIBUTE, descriptor.getDescription());
203
		attribute(DESCRIPTION_ATTRIBUTE, descriptor.getDescription());
204
		attribute(UPDATE_DESCRIPTOR_URL, descriptor.getLocation());
204
		end(UPDATE_DESCRIPTOR_ELEMENT);
205
		end(UPDATE_DESCRIPTOR_ELEMENT);
205
	}
206
	}
206
207
207
	protected void writeApplicabilityScope(IRequirement[][] capabilities) {
208
	protected void writeApplicabilityScope(IRequirement[][] capabilities) {
208
		start(APPLICABILITY_SCOPE);
209
		start(APPLICABILITY_SCOPE);
(-)a/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java (+1 lines)
Lines 87-93 Link Here
87
	public static final String TOUCHPOINT_DATA_INSTRUCTION_KEY_ATTRIBUTE = "key"; //$NON-NLS-1$
87
	public static final String TOUCHPOINT_DATA_INSTRUCTION_KEY_ATTRIBUTE = "key"; //$NON-NLS-1$
88
	public static final String TOUCHPOINT_DATA_INSTRUCTION_IMPORT_ATTRIBUTE = "import"; //$NON-NLS-1$
88
	public static final String TOUCHPOINT_DATA_INSTRUCTION_IMPORT_ATTRIBUTE = "import"; //$NON-NLS-1$
89
89
90
	// Constants for attributes of an update descriptor
90
	// Constants for attributes of an update descriptor
91
	public static final String UPDATE_DESCRIPTOR_SEVERITY = "severity"; //$NON-NLS-1$
91
	public static final String UPDATE_DESCRIPTOR_SEVERITY = "severity"; //$NON-NLS-1$
92
	public static final String UPDATE_DESCRIPTOR_URL= "url"; //$NON-NLS-1$
92
93
93
}
94
}
(-)a/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AdviceFileParser.java (-2 / +18 lines)
Lines 26-35 Link Here
26
	private static final String VERSION_SUBSTITUTION = "$version$"; //$NON-NLS-1$
26
	private static final String VERSION_SUBSTITUTION = "$version$"; //$NON-NLS-1$
27
27
28
	private static final String UPDATE_DESCRIPTION = "update.description"; //$NON-NLS-1$
28
	private static final String UPDATE_DESCRIPTION = "update.description"; //$NON-NLS-1$
29
	private static final String UPDATE_SEVERITY = "update.severity"; //$NON-NLS-1$
29
	private static final String UPDATE_SEVERITY = "update.severity"; //$NON-NLS-1$
30
	private static final String UPDATE_RANGE = "update.range"; //$NON-NLS-1$
30
	private static final String UPDATE_RANGE = "update.range"; //$NON-NLS-1$
31
	private static final String UPDATE_URL = "update.url"; //$NON-NLS-1$
31
	private static final String UPDATE_ID = "update.id"; //$NON-NLS-1$
32
	private static final String UPDATE_ID = "update.id"; //$NON-NLS-1$
32
	private static final String CLASSIFIER = "classifier"; //$NON-NLS-1$
33
	private static final String CLASSIFIER = "classifier"; //$NON-NLS-1$
33
	private static final String TOUCHPOINT_VERSION = "touchpoint.version"; //$NON-NLS-1$
34
	private static final String TOUCHPOINT_VERSION = "touchpoint.version"; //$NON-NLS-1$
34
	private static final String TOUCHPOINT_ID = "touchpoint.id"; //$NON-NLS-1$
35
	private static final String TOUCHPOINT_ID = "touchpoint.id"; //$NON-NLS-1$
35
	private static final String COPYRIGHT_LOCATION = "copyright.location"; //$NON-NLS-1$
36
	private static final String COPYRIGHT_LOCATION = "copyright.location"; //$NON-NLS-1$
Lines 162-171 Link Here
162
	private IUpdateDescriptor parseUpdateDescriptor(String prefix, String id) {
163
	private IUpdateDescriptor parseUpdateDescriptor(String prefix, String id) {
163
		String name = id;
164
		String name = id;
164
		String description = null;
165
		String description = null;
165
		String range = "[0.0.0,$version$)"; //$NON-NLS-1$ 
166
		String range = "[0.0.0,$version$)"; //$NON-NLS-1$ 
166
		String severity = "0"; //$NON-NLS-1$
167
		String severity = "0"; //$NON-NLS-1$
168
		URI unitUpdateLocation = null;
167
169
168
		while (current != null && current.startsWith(prefix)) {
170
		while (current != null && current.startsWith(prefix)) {
169
			String token = current;
171
			String token = current;
170
			if (token.equals(UPDATE_ID)) {
172
			if (token.equals(UPDATE_ID)) {
171
				name = currentValue();
173
				name = currentValue();
Lines 173-191 Link Here
173
				description = currentValue();
175
				description = currentValue();
174
			} else if (token.equals(UPDATE_RANGE)) {
176
			} else if (token.equals(UPDATE_RANGE)) {
175
				range = currentValue();
177
				range = currentValue();
176
			} else if (token.equals(UPDATE_SEVERITY)) {
178
			} else if (token.equals(UPDATE_SEVERITY)) {
177
				severity = currentValue();
179
				severity = currentValue();
180
			} else if (token.equals(UPDATE_URL)) {
181
				try {
182
					unitUpdateLocation = new URI(currentValue());
183
				} catch (URISyntaxException e) {
184
					throw new IllegalStateException("bad unit update URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$
185
				}
178
			} else {
186
			} else {
179
				// ignore
187
				// ignore
180
			}
188
			}
181
			next();
189
			next();
182
		}
190
		}
183
191
184
		range = substituteVersionAndQualifier(range);
192
		range = substituteVersionAndQualifier(range);
185
		VersionRange versionRange = new VersionRange(range);
193
		VersionRange versionRange = new VersionRange(range);
186
		return MetadataFactory.createUpdateDescriptor(name, versionRange, Integer.valueOf(severity), description);
194
		return MetadataFactory.createUpdateDescriptor(name, versionRange, Integer.valueOf(severity), description, unitUpdateLocation);
187
	}
195
	}
188
196
189
	private void parseProvides(String prefix, List<IProvidedCapability> provides) {
197
	private void parseProvides(String prefix, List<IProvidedCapability> provides) {
190
		while (current != null && current.startsWith(prefix)) {
198
		while (current != null && current.startsWith(prefix)) {
191
			int dotIndex = current.indexOf('.', prefix.length());
199
			int dotIndex = current.indexOf('.', prefix.length());
Lines 314-323 Link Here
314
322
315
		String unitUpdateId = null;
323
		String unitUpdateId = null;
316
		VersionRange unitUpdateRange = null;
324
		VersionRange unitUpdateRange = null;
317
		int unitUpdateSeverity = 0;
325
		int unitUpdateSeverity = 0;
318
		String unitUpdateDescription = null;
326
		String unitUpdateDescription = null;
327
		URI unitUpdateLocation = null;
319
328
320
		List<IArtifactKey> unitArtifacts = new ArrayList<IArtifactKey>();
329
		List<IArtifactKey> unitArtifacts = new ArrayList<IArtifactKey>();
321
		Map<String, String> unitProperties = new HashMap<String, String>();
330
		Map<String, String> unitProperties = new HashMap<String, String>();
322
		List<IRequirement> unitHostRequirements = new ArrayList<IRequirement>();
331
		List<IRequirement> unitHostRequirements = new ArrayList<IRequirement>();
323
		List<IProvidedCapability> unitProvides = new ArrayList<IProvidedCapability>();
332
		List<IProvidedCapability> unitProvides = new ArrayList<IProvidedCapability>();
Lines 363-372 Link Here
363
				unitUpdateSeverity = Integer.parseInt(currentValue());
372
				unitUpdateSeverity = Integer.parseInt(currentValue());
364
				next();
373
				next();
365
			} else if (token.equals(UPDATE_DESCRIPTION)) {
374
			} else if (token.equals(UPDATE_DESCRIPTION)) {
366
				unitUpdateDescription = currentValue();
375
				unitUpdateDescription = currentValue();
367
				next();
376
				next();
377
			} else if (token.equals(UPDATE_URL)) {
378
				try {
379
					unitUpdateLocation = new URI(currentValue());
380
				} catch (URISyntaxException e) {
381
					throw new IllegalStateException("bad unit update URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$
382
				}
383
				next();
368
			} else if (token.startsWith(HOST_REQUIREMENTS_PREFIX))
384
			} else if (token.startsWith(HOST_REQUIREMENTS_PREFIX))
369
				parseRequires(prefix + HOST_REQUIREMENTS_PREFIX, unitHostRequirements);
385
				parseRequires(prefix + HOST_REQUIREMENTS_PREFIX, unitHostRequirements);
370
			else if (token.startsWith(ARTIFACTS_PREFIX))
386
			else if (token.startsWith(ARTIFACTS_PREFIX))
371
				parseArtifacts(prefix + ARTIFACTS_PREFIX, unitArtifacts);
387
				parseArtifacts(prefix + ARTIFACTS_PREFIX, unitArtifacts);
372
			else if (token.startsWith(LICENSES_PREFIX))
388
			else if (token.startsWith(LICENSES_PREFIX))
Lines 402-412 Link Here
402
		}
418
		}
403
		if (unitTouchpointId != null)
419
		if (unitTouchpointId != null)
404
			description.setTouchpointType(MetadataFactory.createTouchpointType(unitTouchpointId, unitTouchpointVersion));
420
			description.setTouchpointType(MetadataFactory.createTouchpointType(unitTouchpointId, unitTouchpointVersion));
405
421
406
		if (unitUpdateId != null)
422
		if (unitUpdateId != null)
407
			description.setUpdateDescriptor(MetadataFactory.createUpdateDescriptor(unitUpdateId, unitUpdateRange, unitUpdateSeverity, unitUpdateDescription));
423
			description.setUpdateDescriptor(MetadataFactory.createUpdateDescriptor(unitUpdateId, unitUpdateRange, unitUpdateSeverity, unitUpdateDescription, unitUpdateLocation));
408
424
409
		if (!unitLicenses.isEmpty())
425
		if (!unitLicenses.isEmpty())
410
			description.setLicenses(unitLicenses.toArray(new ILicense[unitLicenses.size()]));
426
			description.setLicenses(unitLicenses.toArray(new ILicense[unitLicenses.size()]));
411
427
412
		if (!unitArtifacts.isEmpty())
428
		if (!unitArtifacts.isEmpty())

Return to bug 354260