summaryrefslogtreecommitdiff
path: root/lib/sbin/ConfigurationParser.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-09-30 12:51:31 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-09-30 12:51:31 +0000
commitde4ddf226c8b8f842d3ee40319fcc4f693899903 (patch)
treec2f851aeb3220f765247099ad0b1b3af76a289f0 /lib/sbin/ConfigurationParser.pl
parenteb75db00165b16e86b94f9aa56c61f8fea601dc3 (diff)
Applying patch from Josh Abadie to detect cyclic dependencies.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4156 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ConfigurationParser.pl')
-rw-r--r--lib/sbin/ConfigurationParser.pl53
1 files changed, 24 insertions, 29 deletions
diff --git a/lib/sbin/ConfigurationParser.pl b/lib/sbin/ConfigurationParser.pl
index f9df527a..60cf64a9 100644
--- a/lib/sbin/ConfigurationParser.pl
+++ b/lib/sbin/ConfigurationParser.pl
@@ -111,33 +111,24 @@ sub CreateConfigurationDatabase
}
}
-# Disable the check for cyclic dependencies.
-# The code is very useful in principle, and will probably be re-enabled
-# soon (today is 2005-08-23), so I keep it, but comment it out.
-# Unfortunately, there is currently code that needs to have these cyclic
-# dependencies, so it is not possible to abort and not desirable to warn
-# for these cases.
-# Any problems with cyclic dependencies will be reported by the linker
-# later anyway.
-#
-## Check for cyclic dependencies
-## create a hash with thorn-> used thorns (no prefix)
-# foreach $thorn (sort keys %thorns)
-# {
-# $thorn_dependencies{uc($thorn)}=$cfg{"\U$thorn\E USES THORNS"};
-# }
-#
-# $message = &find_dep_cycles(%thorn_dependencies);
-#
-# if ("" ne $message)
-# {
-# $message =~ s/^\s*//g;
-# $message =~ s/\s*$//g;
-# $message =~ s/\s+/->/g;
-# $message = "Found a cyclic dependency in configuration requirements:".$message."\n";
-# &CST_error(0,$message,$hint,__LINE__,__FILE__);
-# }
-#
+# Check for cyclic dependencies
+# create a hash with thorn-> used thorns (no prefix)
+ foreach $thorn (sort keys %thorns)
+ {
+ $thorn_dependencies{uc($thorn)}=$cfg{"\U$thorn\E USES THORNS"};
+ }
+
+ $message = &find_dep_cycles(%thorn_dependencies);
+
+ if ("" ne $message)
+ {
+ $message =~ s/^\s*//g;
+ $message =~ s/\s*$//g;
+ $message =~ s/\s+/->/g;
+ $message = "Found a cyclic dependency in configuration requirements:".$message."\n";
+ &CST_error(0,$message,$hint,__LINE__,__FILE__);
+ }
+
# # Print configuration database
# my($field);
@@ -207,7 +198,9 @@ sub ParseConfigurationCCL
}
elsif($line =~ m/^\s*REQUIRES\s+THORNS\s*:\s*(.*)/i)
{
- $cfg->{"\U$thorn\E REQUIRES THORNS"} .= "$1";
+ my $temp = $1;
+ $temp =~ s/\b$thorn\b//i;
+ $cfg->{"\U$thorn\E REQUIRES THORNS"} .= $temp;
# if ($cfg->{"\U$thorn\E REQUIRES THORNS"})
# {
# &CST_error (3, '\'Requires Thorns\' will not be supported in release beta-14' .
@@ -216,7 +209,9 @@ sub ParseConfigurationCCL
}
elsif($line =~ m/^\s*REQUIRES\s*(.*)/i)
{
- $cfg->{"\U$thorn\E REQUIRES"} .= "$1 ";
+ my $temp = $1;
+ $temp =~ s/\b$thorn\b//i;
+ $cfg->{"\U$thorn\E REQUIRES"} .= "$temp ";
}
elsif($line =~ m/^\s*OPTIONAL\s*/i)
{