From 2d7e463111c208c9ec8f3f406ddb3c035d4f737a Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Apr 2008 14:23:27 +0000 Subject: and make it work right... git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9587 e03df62e-2008-0410-955e-edbf42e46eb7 --- make/utilities.pm | 49 +++++++++++++++---------------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) (limited to 'make') diff --git a/make/utilities.pm b/make/utilities.pm index 8b8241e04..fc7ce13d2 100644 --- a/make/utilities.pm +++ b/make/utilities.pm @@ -322,57 +322,38 @@ sub translate_functions($$) die "Developers should no longer use backticks in configuration macros. Please use exec() and eval() macros instead. Offending line: $line (In module: $module)"; } - if ($line =~ /\$EndIf/) + if ($line =~ /ifuname\(\!"(\w+)"\)/) { - if ($if_skip_lines == 1) - { - $if_skip_lines = 0; - return; - } - else - { - die "\$EndIf found when not in \$If/\$IfUname in $module"; - } - } - - if ($line =~ /\$Else/) - { - if ($if_skip_lines == 0) - { - $if_skip_lines = 1; - } - else + my $uname = $1; + if ($uname eq $^O) { - $if_skip_lines = 0; + $line = ""; + return ""; } - return; - } - if ($if_skip_lines == 1) - { - return; + $line =~ s/ifuname\(\!"(.+?)"\)//; } - if ($line =~ /\$IfUname\s+(\w+)/) + if ($line =~ /ifuname\("(\w+)"\)/) { my $uname = $1; if ($uname ne $^O) { - $if_skip_lines = 1; - return; + $line = ""; + return ""; } + + $line =~ s/ifuname\("(.+?)"\)//; } - if ($line =~ /\$If:\s+(\w+)/) + if ($line =~ /if\("(\w+)"\)/) { if (defined $main::config{$1}) { - if (($main::config{$1} !~ /y/i) and ($main::config{$1} ne "1")) - { - $if_skip_lines = 1; - return; - } + return "" if (($main::config{$1} !~ /y/i) and ($main::config{$1} ne "1")) } + + $line =~ s/if\("(.+?)"\)//; } while ($line =~ /exec\("(.+?)"\)/) -- cgit v1.2.3