From df90d201e027b7b420f63619e19926afe0cae40e Mon Sep 17 00:00:00 2001 From: sbrandt Date: Wed, 22 Jan 2014 19:58:46 +0000 Subject: Fix for ticket #1524 git-svn-id: http://svn.cactuscode.org/flesh/trunk@5068 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/ConfigScriptParser.pl | 47 +++++++++--------------------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/lib/sbin/ConfigScriptParser.pl b/lib/sbin/ConfigScriptParser.pl index 80cb1a18..d98a90dc 100644 --- a/lib/sbin/ConfigScriptParser.pl +++ b/lib/sbin/ConfigScriptParser.pl @@ -37,43 +37,16 @@ sub ParseConfigScript next if ! $line; # Parse the line - if ($line =~ m/^\s*BEGIN\s+DEFINE\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+DEFINE\s*/i) { - $cfg->{"\U$thorn $provides\E DEFINE"} .= "$line\n"; - $line = <$lines>; chomp $line; ++$line_number; - } - } elsif ($line =~ m/^\s*BEGIN\s+INCLUDE\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+INCLUDE\s*/i) { - $cfg->{"\U$thorn $provides\E INCLUDE"} .= "$line\n"; - $line = <$lines>; chomp $line; ++$line_number; - } - } elsif ($line =~ m/^\s*BEGIN\s+ERROR\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+ERROR\s*/i) { - $cfg->{"\U$thorn $provides\E ERROR"} .= "$line\n"; - print "ERROR: $line\n"; - $line = <$lines>; chomp $line; ++$line_number; - } - } elsif ($line =~ m/^\s*BEGIN\s+MESSAGE\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+MESSAGE\s*/i) { - $cfg->{"\U$thorn $provides\E MESSAGE"} .= "$line\n"; - print "$line\n"; - $line = <$lines>; chomp $line; ++$line_number; - } - } elsif ($line =~ m/^\s*BEGIN\s+MAKE_DEFINITION\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+MAKE_DEFINITION\s*/i) { - $cfg->{"\U$thorn $provides\E MAKE_DEFINITION"} .= "$line\n"; - $line = <$lines>; chomp $line; ++$line_number; - } - } elsif ($line =~ m/^\s*BEGIN\s+MAKE_DEPENDENCY\s*/i) { - $line = <$lines>; chomp $line; ++$line_number; - while ($line !~ m/^\s*END\s+MAKE_DEPENDENCY\s*/i) { - $cfg->{"\U$thorn $provides\E MAKE_DEPENDENCY"} .= "$line\n"; - $line = <$lines>; chomp $line; ++$line_number; + if ($line =~ m/^\s*BEGIN\s+(DEFINE|INCLUDE|ERROR|MESSAGE|MAKE_DEFINITION|MAKE_DEPENDENCY)\s*/i) { + my $terminal = "\U$1"; + while(($line = <$lines>) && ($line !~ m/^\s*END\s+${terminal}\s*/i)) { + chomp $line; ++$line_number; + $cfg->{"\U$thorn $provides\E ${terminal}"} .= "$line\n"; + if($terminal eq "MESSAGE") { + print "$line\n"; + } elsif($terminal eq "ERROR") { + print "ERROR: $line\n"; + } } } elsif ($line =~ m/^\s*INCLUDE_DIRECTORY\s+(.*)$/i) { $cfg->{"\U$thorn $provides\E INCLUDE_DIRECTORY"} .= " $1"; -- cgit v1.2.3