diff options
author | yye00 <yye00@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-08-16 17:26:48 +0000 |
---|---|---|
committer | yye00 <yye00@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-08-16 17:26:48 +0000 |
commit | 8c8a283caecd5acddb6466c79be1513aae2fb70c (patch) | |
tree | 642b03bc32935a83799268c00a00cd65d7d754c7 /lib/sbin/ConfigurationParser.pl | |
parent | 8bbd884aa6aa78bb0b60eae385f4d9ba0de92982 (diff) |
configuration.ccl fix. Please test and report if anything breaks
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4109 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ConfigurationParser.pl')
-rw-r--r-- | lib/sbin/ConfigurationParser.pl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/sbin/ConfigurationParser.pl b/lib/sbin/ConfigurationParser.pl index 346b4c75..41500f50 100644 --- a/lib/sbin/ConfigurationParser.pl +++ b/lib/sbin/ConfigurationParser.pl @@ -24,7 +24,7 @@ sub CreateConfigurationDatabase { my($config_dir, %thorns) = @_; my(%cfg) = (); - my($thorn, $required, @missing, @foundlist, $founderrlist, $filename, %thorncap, $foundcap, $temp,$cap); + my($thorn, $required, @missing, @foundlist, $founderrlist, $filename, %thorncap, $foundcap, $temp,$cap,$message,$hint); # Loop through each thorn's configuration file. foreach $thorn (sort keys %thorns) @@ -111,7 +111,26 @@ sub CreateConfigurationDatabase } } - # # Print configuration database +# 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); # foreach $field ( sort keys %cfg) # { @@ -194,6 +213,7 @@ sub ParseConfigurationCCL { ($optional, $define, $line_number) = &ParseOptionalBlock($line_number, \@data); $cfg->{"\U$thorn\E OPTIONAL"} .= "$optional "; + $cfg->{"\U$thorn\E OPTIONAL \U$optional\E DEFINE"} = $define; } elsif($line =~ m/^\s*NO_SOURCE\s*/i) { |