diff options
Diffstat (limited to 'lib/sbin/CST')
-rw-r--r-- | lib/sbin/CST | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/sbin/CST b/lib/sbin/CST index 6dea94ca..8108da7c 100644 --- a/lib/sbin/CST +++ b/lib/sbin/CST @@ -591,12 +591,26 @@ sub TopoSort { $thorn_ancestor{"\U$thorn\E"} .= $interface->{"IMPLEMENTATION \U$ancestor_imp\E THORNS"}. ' '; } + $thorn_requires{"\U$thorn\E"} = ''; + foreach $capability (split(' ', $cfg->{"\U$thorn REQUIRES\E"})) + { + foreach $thorn2 (sort keys %thorns) + { + foreach $capability2 (split(' ', $cfg->{"\U$thorn2 PROVIDES\E"})) + { + if ("\U$capability\E" eq "\U$capability2\E") + { + $thorn_requires{"\U$thorn\E"} .= " $thorn2"; + } + } + } + } - my @uses_thorns = split (' ', $cfg->{"\U$thorn\E USES THORNS"} . ' ' . $thorn_ancestor{"\U$thorn\E"}); + my @uses_thorns = split (' ', $cfg->{"\U$thorn\E USES THORNS"} . ' ' . $cfg->{"\U$thorn\E REQUIRES THORNS"} . ' ' . $thorn_requires{"\U$thorn\E"} . ' ' . $thorn_ancestor{"\U$thorn\E"}); my $uses_thorns = ''; foreach (@uses_thorns) { - # ignore if a thorn wants to use only itself + # ignore if a thorn wants to use itself # otherwise we'll get a cyclic list later in the topological sort $uses_thorns .= "$thorn $_\n" if ($thorn ne $_); } |