handling circular dependencies
wookietreiber
kizkizzbangbang at googlemail.com
Mon Jan 17 21:26:16 CET 2011
I made a for lvu resolving the infinite recursion of show_tree.
See attachment.
On Sat, Jan 15, 2011 at 10:18:04PM +0100, wookietreiber wrote:
> Hello,
>
> revising the configuration of 'cairo' and much around it (take a look at the module submission queue) I discovered some circular dependencies ('libspectre', 'poppler' and 'librsvg' should actually be optional dependencies for 'cairo') and how troublesome and annoying they can be ... for now I handled them with POST_INSTALL and POST_REMOVE, which, of course, isn't the most elegant way to do this ...
>
> ... so, what about a new function (e.g. called 'circ_depends') for '/var/lib/lunar/functions/depends.lunar' or, which would be even better, a revision of 'depends' and 'optional_depends', to handle circular dependencies directly in the lunar tools?
>
> Generally, I don't know if it's just 'lvu tree module_with_circ_dep' breaking by going in an infinite loop or if it concerns other lunar tools as well -- I'm just not deep enough in it yet, but intend to :)
>
> The intention of this mail is to encourage us to provide thoughts on what to consider to implement good circular dependency handling functionality and eventually, well, implement it :)
>
> Best Regards
> Christian Krause aka wookietreiber
>
> P.S.: I'll start with some thoughts soon :)
> P.S.S.: Maybe someone knows other functions like 'lvu tree ...' which fail and post it to this thread -- this would help to find everything that breaks or may break.
-------------- next part --------------
605,611c605,615
< grep -q "^$DEP$" $TMP_SEEN
< TEST=$?
< if [ "$TEST" == "1" -o -z "$SHORTTREE" ] ; then
< echo "$DEP" >> $TMP_SEEN
< CUR=${DEP:0:1}
< # note the FLAG= thingy here
< FLAG= show_tree ${DEP:1} 2> /dev/null
---
> # recurse only if module is not root to avoid going on
> # indefinetely with circular dependencies
> if [ ${DEP:1} != $ROOT ]; then
> grep -q "^$DEP$" $TMP_SEEN
> TEST=$?
> if [ "$TEST" == "1" -o -z "$SHORTTREE" ] ; then
> echo "$DEP" >> $TMP_SEEN
> CUR=${DEP:0:1}
> # note the FLAG= thingy here
> FLAG= show_tree ${DEP:1} 2> /dev/null
> fi
1338a1343
> ROOT="$2"
1342a1348
> ROOT="$2"
1347a1354
> ROOT="$2"
1352a1360
> ROOT="$2"
More information about the Lunar-dev
mailing list