[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] How to recognize Categories, Features, Bundles and Products?

Perhaps some information on why you are doing this would help.  It seems that you are infering some semantics from things that just *happen* to be a certain way. This may change in the future so understanding what you are actually looking for would help.

Jeff



On 18-Sep-09, at 5:53 AM, Filip Hrbek wrote:

Hi all,

I have difficulties with IU analysis. I wonder what determines the type of an IU.

Basically we can analyze following properties:

1) does ID end with ".feature.group" or not?
2) is "org.eclipse.equinox.p2.type.category" set to true?
3) is "org.eclipse.equinox.p2.type.group" set to true?

My guess is that this we could use following algorithm:

        if("true".equalsIgnoreCase(iu.getProperty(IInstallableUnit.PROP_TYPE_CATEGORY))) {
            if("true".equalsIgnoreCase(iu.getProperty(IInstallableUnit.PROP_TYPE_GROUP)))
                return NESTED_CATEGORY;
            else
                return CATEGORY;
        }
        if("true".equalsIgnoreCase(iu.getProperty(IInstallableUnit.PROP_TYPE_GROUP)))
            return PRODUCT;
        if(iu.getId().endsWith(".feature.group"))
            return FEATURE;
        if(iu.isFragment())
            return FRAGMENT;
        if(iu.isBundle())
            return BUNDLE;
        return OTHER;

You may have noticed that I also used two category variants - normal and nested. This is an attempt to handle cases such as http://download.eclipse.org/releases/galileo | General Purpose Tools | PDE/API Tools Environment Descriptions.

The algorithm looks fairly complicated. Is there any standard method for this in p2 code? If not, is my suggestion correct?

Thanks,

Filip

-- 
Filip Hrbek  |  filip.hrbek@xxxxxxxxxxxxxx  |  +420.777.662642  |  skype: filip.hrbek
CLOUDSMITH  |  Czech Republic
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev