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 133970 Details for
Bug 261104
[publisher] Versioning Categories
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]
Adds version numbers to categories
clipboard.txt (text/plain), 2.08 KB, created by
Ian Bull
on 2009-04-30 13:05:03 EDT
(
hide
)
Description:
Adds version numbers to categories
Filename:
MIME Type:
Creator:
Ian Bull
Created:
2009-04-30 13:05:03 EDT
Size:
2.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.updatesite >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.20 >diff -u -r1.20 SiteXMLAction.java >--- src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 25 Apr 2009 23:02:41 -0000 1.20 >+++ src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 30 Apr 2009 17:04:59 -0000 >@@ -269,7 +269,8 @@ > cat.setSingleton(true); > String categoryId = buildCategoryId(category.getName()); > cat.setId(categoryId); >- cat.setVersion(Version.emptyVersion); >+ >+ cat.setVersion(Version.createOSGi(0, 0, 0, getDateQualifier())); > String label = category.getLabel(); > cat.setProperty(IInstallableUnit.PROP_NAME, label != null ? label : category.getName()); > cat.setProperty(IInstallableUnit.PROP_DESCRIPTION, category.getDescription()); >@@ -326,4 +327,27 @@ > return categoryName; > } > >+ /* >+ * Returns the current date/time as a string to be used as a qualifier >+ * replacement. This is the default qualifier replacement. Will >+ * be of the form YYYYMMDDHHMM. >+ * @return current date/time as a qualifier replacement >+ */ >+ private static String getDateQualifier() { >+ final String empty = ""; //$NON-NLS-1$ >+ int monthNbr = Calendar.getInstance().get(Calendar.MONTH) + 1; >+ String month = (monthNbr < 10 ? "0" : empty) + monthNbr; //$NON-NLS-1$ >+ >+ int dayNbr = Calendar.getInstance().get(Calendar.DAY_OF_MONTH); >+ String day = (dayNbr < 10 ? "0" : empty) + dayNbr; //$NON-NLS-1$ >+ >+ int hourNbr = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); >+ String hour = (hourNbr < 10 ? "0" : empty) + hourNbr; //$NON-NLS-1$ >+ >+ int minuteNbr = Calendar.getInstance().get(Calendar.MINUTE); >+ String minute = (minuteNbr < 10 ? "0" : empty) + minuteNbr; //$NON-NLS-1$ >+ >+ return empty + Calendar.getInstance().get(Calendar.YEAR) + month + day + hour + minute; >+ } >+ > }
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 261104
: 133970 |
135198