Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330735 - [publisher] A "better" id for the categories would be helpful
Summary: [publisher] A "better" id for the categories would be helpful
Status: RESOLVED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All Windows XP
: P3 major (vote)
Target Milestone: 3.6.1   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-20 09:03 EST by Marco Lehmann-Mörz CLA
Modified: 2011-07-13 08:57 EDT (History)
4 users (show)

See Also:


Attachments
Sample Babel site.xml (266.50 KB, text/xml)
2010-11-24 13:54 EST, Kit Lo CLA
no flags Details
Babel language pack category (4.21 KB, image/png)
2011-07-13 08:57 EDT, Kit Lo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Lehmann-Mörz CLA 2010-11-20 09:03:20 EST
Build Identifier: 

NL-categories should also reflect the version of the platform they are built for and not 1.0.0. The features are allright.
BTW, please give the categories identifiers that make more sense than "file:/home/babel-working/live/output/helios/site.xml.Babel Language Packs in Arabic".


Reproducible: Always

Steps to Reproduce:
Use B3 to aggregate eclipse-sdk and NL from Babel for Helios and Galileo (because several nl-fragments are still missing there e.g. GEF). We use the categories to mirror all features and bundles in this category.
Result is: all categories from Babel Galileo repository will be mirrored instead of the ones from Helios.
Comment 1 Marco Lehmann-Mörz CLA 2010-11-24 03:25:23 EST
The version seems to be not really the problem, but a "better" id for the categories would by helpful.
I try to assemble a target platform containing some features (eclipse-rcp, emf, gef, ...) and its corresponding nl-fragments in all supported languages. So I use B3 to aggregate everything into one final repository. BTW, an additional top-level category "all languages" would by very handy instead of naming all categories from helios and galileo, because not all projects from galileo have nl-fragments for helios.
Comment 2 Marco Lehmann-Mörz CLA 2010-11-24 04:50:59 EST
p2 director accepts IUs in the form <id> [ '/' <version> ]

the current category ids (file:/home/...) prevent me from using the director application to install nl-bundles, at least on windows.
Comment 3 Kit Lo CLA 2010-11-24 13:53:55 EST
Babel uses the UpdateSitePublisher to convert the Babel update site to a p2 repository. The generated unit id (e.g. "file:/home/babel-working/live/output/helios/site.xml.Babel Language Packs in
Arabic") is preventing users from using the director application to install nl-bundles, at least on windows.
Comment 4 Kit Lo CLA 2010-11-24 13:54:55 EST
Created attachment 183790 [details]
Sample Babel site.xml
Comment 5 Kit Lo CLA 2010-11-24 16:14:58 EST
Excerpt from content.xml:

    <unit id="file:/home/babel-working/live/output/helios/site.xml.Babel Language Packs in Arabic" version="1.0.0._HCY-cLVmbNF0gKBFBGHOUEXTUBD">
      <properties size="3">
        <property name="org.eclipse.equinox.p2.name" value="Babel Language Packs in Arabic"/>
        <property name="org.eclipse.equinox.p2.description" value="Babel Language Packs in Arabic"/>
        <property name="org.eclipse.equinox.p2.type.category" value="true"/>
      </properties>
      <provides size="1">
        <provided namespace="org.eclipse.equinox.p2.iu" name="file:/home/babel-working/live/output/helios/site.xml.Babel Language Packs in Arabic" version="1.0.0._HCY-cLVmbNF0gKBFBGHOUEXTUBD"/>
      </provides>
      <requires size="35">
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_technology.egit_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_eclipse_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_dsdp.mtj_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.cdt_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_rt.equinox_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.emft.eef_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.gmp.gmf-tooling_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.mdt.ocl_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_technology.linux-distros_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_birt_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.common_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.ptp_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_dsdp.tm_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_technology.actf_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.servertools_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.jsdt_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.mylyn_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.mat_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.gmp.gmf-runtime_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.jeetools_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.sourceediting_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_dsdp.sequoyah_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.jsf_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.gef_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.emf.validation_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.ejbtools_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_tools.ptp.photran_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_rt.rap_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_datatools_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_modeling.gmp.gmf-notation_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.webservices_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_technology.jgit_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_technology.packaging.mpc_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_webtools.dali_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
        <required namespace="org.eclipse.equinox.p2.iu" name="org.eclipse.babel.nls_rt.equinox.p2_ar.feature.group" range="[3.6.0.v20101124043401,3.6.0.v20101124043401]"/>
      </requires>
      <touchpoint id="null" version="0.0.0"/>
    </unit>
Comment 6 Kit Lo CLA 2011-06-12 01:49:12 EDT
p2 team, reporter requested a "better" id for the categories in comment 1.

Babel uses the UpdateSitePublisher to convert the Babel update site to a p2
repository. The unit id is generated by p2. Can p2 look into generating a "better" id?
Comment 7 Pascal Rapicault CLA 2011-06-12 21:04:30 EDT
Marco, Kit, out of the content.xml shown by Kit (or another sample of yours), which part would you like to see changed. Thx
Comment 8 Marco Lehmann-Mörz CLA 2011-06-14 04:52:37 EDT
(In reply to comment #7)
> Marco, Kit, out of the content.xml shown by Kit (or another sample of yours),
> which part would you like to see changed. Thx

Hi Pascal,

I think a good staring point would be

id=org.eclipse.babel.nls_ar.category (from Kit's example)
version=3.6.0

Are there any plans to support an uber-feature or uber-category to include all languages in one category or feature. So one could consume only one feature or category (in a b3 aggregation for example) to install all available language-bundles for a set of features and plug-ins.
Comment 9 Andrew Niefer CLA 2011-06-20 16:24:48 EDT
The p2 code (SiteXMLAction) supports specifying a version and a categoryQualifier.
The IU then is named categoryQualifier + '.' + categoryName

Note that in the site xml, there is a "name" and a "label".  Here "name" should is the "id".

So you can do something like:
 <category-def name="nls_ar.category" label="Babel Language Packs in Arabic"/>
and then pass 
categoryQualifier=org.eclipse.babel
categoryVersion=3.6.0
to achieve the desired result.

If categoryQualifier is the empty string, then the IU id will just be categoryName.  So you could also do
<category-def name="org.eclipse.babel.nls_ar.category" label="Babel Language Packs in Arabic"/>
categoryQualifier=""


I believe this is sufficient to get a "better" id.

The command line application "org.eclipse.equinox.p2.publisher.UpdateSitePublisher" supports setting these with "-categoryQualifier" and "-categoryVersion" arguments.
PDE/Build allows specifying these with the following properties:
"p2.category.prefix",  "p2.category.version". 

Since comment #0 indicates you are using B3, I will move this bug there for comment on whether or not they support setting these values.
Comment 10 Kit Lo CLA 2011-06-28 11:22:29 EDT
Hi Marco, I followed Andrew's suggestion to change the "category-def" in Babel to the "org.eclipse.babel.nls_<locale>" pattern. The unit IDs in Babel p2 repository look better. Could you try the latest Babel p2 repositories again?

http://build.eclipse.org/technology/babel/update-site/N20110628-0400/indigo/
http://build.eclipse.org/technology/babel/update-site/N20110628-0400/helios/
Comment 11 Marco Lehmann-Mörz CLA 2011-06-29 05:55:51 EDT
I downloaded both versions of content.jar and they both contain only one category (Uncategorized). There are no NL-categories. Do I miss something?

(In reply to comment #10)
> Hi Marco, I followed Andrew's suggestion to change the "category-def" in Babel
> to the "org.eclipse.babel.nls_<locale>" pattern. The unit IDs in Babel p2
> repository look better. Could you try the latest Babel p2 repositories again?
> 
> http://build.eclipse.org/technology/babel/update-site/N20110628-0400/indigo/
> http://build.eclipse.org/technology/babel/update-site/N20110628-0400/helios/
Comment 12 Thomas Hallgren CLA 2011-07-07 12:40:46 EDT
B3 doesn't normally deal with categories. It will simply mirror the IU's that represent them. You can model custom categories to be injected in the result or give existing categories different prefixes depending on what contribution they stem from, but I don't think that is applicable here.

Now moving the bug back to p2.
Comment 13 Andrew Niefer CLA 2011-07-11 11:24:53 EDT
p2 already supports everything required here.
Comment 14 Kit Lo CLA 2011-07-13 08:57:39 EDT
Created attachment 199576 [details]
Babel language pack category

Just to recap, in http://build.eclipse.org/technology/babel/update-site/N20110713-0400/indigo
the Babel language pack categories now have the ID in "org.eclipse.babel.<proj>" format and categoy versions are now in "3.7.0.vXXXX" format.