Christian Gmeiner dixit:

> So we have a list of packages we need to have, to get subversion
> build, but we need to build them in the correct order.
> We can use the a very simple algorithem to sort them - its a bubblesort :)

No, actually, it's a topological sort:

$ cat x
subversion subversion
subversion apr-utils
subversion libiconv
subversion zlib
apr-utils apr-utils
apr-utils apr
apr-utils libexpat
apr apr
apr libpthread
libiconv libiconv
zlib zlib
libexpat libexpat
libpthread libpthread

$ tsort -r <x
libexpat
zlib
libpthread
apr
apr-utils
libiconv
subversion

cf. http://www.mirbsd.org/man1/tsort.htm or <bsd.port.mk>

bye,
//mirabile
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to