Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Bundle start configuration

Took me a long time to understand what you were getting at, as at first I thought you had an IU and a CU.

I agree that in the case you describe, where an IU carries touchpoint data and there is also a CU attached to it, the behaviour is bogus.
This is slightly different than the bug I was talking about but is a friend of it.

As for right fix (which does not require the previous bug to be fixed), I don't think the attachment logic is the right place and for two reasons:
- The attachment logic should only deal with matching a CU to an IU. The touchpoint data is the business of the engine. Fixing this in here would mean coding in the resolver some specific knowledge about the shape of the metadata for a bundle (in this case the fact that there is manifest, etc) and would not work for any other case.
- Dropping the default CU or any CU when there is something in the main IU would not be very flexible, and I can see how someone would be able to complement someone's data through a CU.

IMO, a more appropriate solution would consists in enhancing the engine and the touchpoint data to allow each instructions section to declare the expected behaviour when the situation arises. At this point I could see several keys: before, after, override, delegate that would control this (as I'm writing this I'm sure we can find better wording in the AspectJ literature). For example, override would say that the value in the CU would override what is specified in the IU; delegate would mean run whatever is in the IU and ignore what is in me the CU; before and after meaning run the CU in addition to the other instructions.


On 2011-12-09, at 9:30 AM, Todorova, Katya wrote:

I can’t think of more specific requirement than the one belowJ
It seems my idea of CUs is not consistent so I would appreciate a little help here.
Having touchpoint data doesn’t lead to creation of CU, right?  On the other hand, instruction parser merges info coming from touchpointdata and attached CU.
So from my point of view having touchpoint instructions and applicable fragment is the only currently possible case where two “fragments” are attached. So, they get merged and the result is bizarre.
Isn’t it local touchpoint data the most specific case?  Is there a conceptual difference between CU and touchpoint data?
Until the bug you mention is fixed, isn’t it better not to attach any CUs if there’s other touchpoint data than manifest details?
Thank you,
    <unit id='test' version='1.0.2' singleton='false'>
      <update id=' test ' range='[0.0.0,1.0.2)' severity='0'/>
      <properties size='2'>
        <property name='' value='test'/>
      <provides size='3'>
        <provided namespace='org.eclipse.equinox.p2.iu' name='test' version='1.0.2'/>
        <provided namespace='osgi.bundle' name='test' version='1.0.2'/>
        <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
      <requires size='2'>
        <required namespace='java.package' name='org.osgi.framework' range='1.5.0'/>
        <required namespace='java.package' name='org.eclipse.osgi.framework.console' range='0.0.0'/>
      <artifacts size='1'>
        <artifact classifier='osgi.bundle' id='test' version='1.0.2'/>
      <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
      <touchpointData size='1'>
        <instructions size='3'>
          <instruction key='manifest'>
            Bundle-ManifestVersion: 2&#xA;Bundle-Activator: Activator&#xA;Bundle-RequiredExecutionEnvironment: JavaSE-1.6&#xA;Import-Package: org.osgi.framework;version=&quot;1.5&quot;,org.eclipse.osgi.framework.console&#xA;Bundle-Name: test&#xA;Manifest-Version: 1.0&#xA;Build-Jdk: 1.6.0_07&#xA;Bundle-SymbolicName: test&#xA;Bundle-Version: 1.0.2 &#xA;
          <instruction key='unconfigure'>
          <instruction key='configure'>
From: p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] On Behalf Of Pascal Rapicault
Sent: vendredi 9 décembre 2011 14:56
To: P2 developer discussions
Subject: Re: [p2-dev] Bundle start configuration
My guess is that this is because the CU requirements on the IU are not specific enough and this causes the fragment to not be attached. The code is in the director AttachmentHelper.
This is likely a friend of which we've discussed before.
On 2011-12-08, at 10:41 AM, Todorova, Katya wrote:

Hi guys,
I’m trying to install in Eclipse a bundle  published with  touchpoint instructions for start level = 3 & start = true (I use p2.inf in bundle META-INF to describe these).
As a result I get a strange mix of the local configuration and default bundle tooling presented in Eclipse – start level is 4 and start flag is true in the final
I assumed that local configuration would be preferred over the default one but it seems it’s not the case. What would be the correct behavior according to you?
Thank you,
p2-dev mailing list
p2-dev mailing list

Back to the top