summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-01-22 19:58:46 +0000
committersbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-01-22 19:58:46 +0000
commitdf90d201e027b7b420f63619e19926afe0cae40e (patch)
tree53a2f60eaee6350ad8c5562a33f726e58f6b5beb
parent2e8ce987b13742a9881d3b7f15742c0a2c0a630b (diff)
Fix for ticket #1524
git-svn-id: http://svn.cactuscode.org/flesh/trunk@5068 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/sbin/ConfigScriptParser.pl47
1 files 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";