Patch to enable local dependencies in zlocal

Gb majinai at warpmail.net
Sat Jan 12 22:23:30 CET 2008


>On Mon, 7 Jan 2008, Kok, Auke wrote:
>
>> the only proper solution that I can see is that we bypass the cache
>> completely if
>> a module is in section "zlocal". This should be fairly easy to code up and
>> I would
>> much rather prefer than this patch
>>
>> Auke
>
>Thank you for your reply.
>
>I agree: your solution is the best.
>
>I will take some time to locate the right spot(s) to change,
>but will try to implement your suggestion.
>
>Gb

Hi,

I don't agree with you anymore. ;)

I have given it another look, and by design lunar is based on depends.cache.
depends.cache is built from the moonbase server,
and it is subsequently used by many functions in various ways.
Trying to circumvent depends.cache is not very effective and is prone to errors.

I now think that any solution not involving changing depends.cache
(when it is recalculated) is not easy and will have many unforeseen consequences.

I have tried to tackle the find_depends function,
only to find out that it is both more difficult and less effective
to make changes there than in the create_depends_cache function.

> the only proper solution that I can see is that we bypass the cache
> completely if
> a module is in section "zlocal". This should be fairly easy to code up

This is not easy for me. Thinking about it, in find_depends
it would be easy to write code to find out if the module foo, for example, 
is in zlocal or not.
But, then you would have to rebuild a sort of foo.depends.cache
(based on the DEPENDS file for foo in zlocal)
and merge/use it with the main depends.cache...

This still does not take into consideration what would happen
if foo depends on bar, and bar too is in zlocal...

Moreover, every time the recursive function find_depends_intern
is called, it would have to test if the dependency under check (let's call it baz)
is in zlocal or not, with a possible further baz.depends.cache, etc.

If you had in mind another solution that I overlook, please let me know.

Otherwise, my previous patch seems to be simpler.
Rebuilding the depends.cache can be done with a new root-side command
of the lunar toolbox; after all, only the sysadmin can fiddle with zlocal
and rebuilding the local depends.cache
would be done only when DEPENDS files in zlocal are modified.

Gb



More information about the Lunar mailing list