"Richard S. Hall" <[EMAIL PROTECTED]> writes:

> I am not sure why you want to add requirements or see adding a
> Resource to the resolver as extra work.

I meant it's extra work for the resolver, as adding a Resource to the
Resolver tells it that we need to go find the given Resource, even
though we know it's already installed.

> Assuming we had the static method in question, the solution to your
> situation would be a process like:
>
>   1. Resource localRes = OBR.bundleToResource(bundle);
>   2. Resolver resolver = repoAdmin.getResolver();
>   3. resolver.add(localRes);
>   4. resolver.resolver();
>   5. resolver.deploy();
>
> This seems pretty simple. How would accessing the requirements make
> this any better or simpler?

It wouldn't make it easier for the user, but it might make it easier
for the OBR code. By analogy, if I buy a kit to make cookies, go home,
and open the kit and discover that it calls for butter and sugar, I
might send someone out to the grocery store with the shopping list:

  o butter
  o sugar

I don't send the person to the store with a shopping list like:

  o cookie kit
  o butter
  o sugar
  (but call me first to see if I have any of these things)

or even:

  o cookie kit
  (everything required by cookie kit)
  (but call me first to see if I have any of these things)

because I already have the first item. I don't want my shopper going
and looking for the cookie kit, or even calling me about it; it's
known to be a settled item from the start.

The difference between the two shopping lists maps to the difference
between RepositoryAdmin.discoverResources() and Resolver.add(). The
former deals only with requirements, while the second deals with
specific Resources and, as a side effect, with their transitive
requirements.

> Or are you worried about making the OBR resolver code simpler?

If not making the code simpler, asking it to do less on my behalf.

> In that case it doesn't matter because OBR has to deal with the case
> that some things might be locally installed no matter what.

I see.

> Ok, thanks for looking into this, when I get the time I will look into
> it.

Please let me know if I can help. As I'm new to Felix, I don't yet
feel qualified to decide /where/ this capability should be
implemented. However, I could probably help implement it.

> I created a JIRA issue to keep track of it.

Thanks.¹


Footnotes: 
¹ https://issues.apache.org/jira/browse/FELIX-178

-- 
Steven E. Harris

Reply via email to