[PATCH] patch for lin need_source function
Jasper Huijsmans
jasper at lunar-linux.org
Tue Apr 13 18:46:48 GMT 2004
Auke Kok wrote:
> Jasper Huijsmans wrote:
>
>> Auke,
>>
>> This seems to fix the problem with limitless lin's being spawned.
>> Doesn't seem to break anything else.
>>
>> The patch removes the subshell (why was it needed?) and adds some code
>> to make the list unique (uniq needs a sorted list, so won't always
>> work). Some other thing were changed as well.
>
>
>
> I'm having difficulties understanding the patch:
>
Me too, I'm afraid :/ It's not at all obvious to me why my version works
and yours doesn't.
> 1) the subshell indeed is unneeded
>
...but not the real problem, of course. Removing the subshell stops the
spawning of 1000s of lin processes, but the loop is still infinite.
> 2) the uniq call without sort was deliberate, as the function returns
> items based on build order. During testing I found that some items were
> returned repeatedly, hence the uniq call. adding a 'sort' would perhaps
> reduce the number of duplicates, but it also would distort the order.
>
Ok, I think I noticed that. I just thought that it is possible to have
different dependencies of a module depend on the same module and then
create duplicates. (confusing sentence, hope it made sense).
> 3) I haven't had time enough to check out how it really works now, maybe
> because also I don't really yet see how you apparently solved the probel
> ;^)
>
It's not obvious to me either. One difference is that I use only one
echo statement to return from the need_source, because I catch the
recursive calls. Seems to fix the duplicated too; could that be the reason?
Also I only run need_source when DEP is not installed. This saves a lot
of needless recursion.
> I'm considering dumping the "new" method and going back to the old style
> download (ie spool al immediately required modules on start, download
> secondary requirements when needed).
>
Well, it really does seem to work now :)
Jasper
More information about the Lunar-dev
mailing list