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

Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java (-1 / +25 lines)
Lines 269-275 Link Here
269
		cat.setSingleton(true);
269
		cat.setSingleton(true);
270
		String categoryId = buildCategoryId(category.getName());
270
		String categoryId = buildCategoryId(category.getName());
271
		cat.setId(categoryId);
271
		cat.setId(categoryId);
272
		cat.setVersion(Version.emptyVersion);
272
273
		cat.setVersion(Version.createOSGi(0, 0, 0, getDateQualifier()));
273
		String label = category.getLabel();
274
		String label = category.getLabel();
274
		cat.setProperty(IInstallableUnit.PROP_NAME, label != null ? label : category.getName());
275
		cat.setProperty(IInstallableUnit.PROP_NAME, label != null ? label : category.getName());
275
		cat.setProperty(IInstallableUnit.PROP_DESCRIPTION, category.getDescription());
276
		cat.setProperty(IInstallableUnit.PROP_DESCRIPTION, category.getDescription());
Lines 326-329 Link Here
326
		return categoryName;
327
		return categoryName;
327
	}
328
	}
328
329
330
	/*
331
	 * Returns the current date/time as a string to be used as a qualifier
332
	 * replacement.  This is the default qualifier replacement.  Will
333
	 * be of the form YYYYMMDDHHMM.
334
	 * @return current date/time as a qualifier replacement 
335
	 */
336
	private static String getDateQualifier() {
337
		final String empty = ""; //$NON-NLS-1$
338
		int monthNbr = Calendar.getInstance().get(Calendar.MONTH) + 1;
339
		String month = (monthNbr < 10 ? "0" : empty) + monthNbr; //$NON-NLS-1$
340
341
		int dayNbr = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
342
		String day = (dayNbr < 10 ? "0" : empty) + dayNbr; //$NON-NLS-1$
343
344
		int hourNbr = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
345
		String hour = (hourNbr < 10 ? "0" : empty) + hourNbr; //$NON-NLS-1$
346
347
		int minuteNbr = Calendar.getInstance().get(Calendar.MINUTE);
348
		String minute = (minuteNbr < 10 ? "0" : empty) + minuteNbr; //$NON-NLS-1$
349
350
		return empty + Calendar.getInstance().get(Calendar.YEAR) + month + day + hour + minute;
351
	}
352
329
}
353
}

Return to bug 261104