diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-27 14:23:27 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-27 14:23:27 +0000 |
commit | 2d7e463111c208c9ec8f3f406ddb3c035d4f737a (patch) | |
tree | 7b60856f4f39df0a1ce530d313f6201863d52ac1 /make/utilities.pm | |
parent | 1b8b477efcececa6adcc12c34c891657aaef806c (diff) |
and make it work right...
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9587 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/utilities.pm')
-rw-r--r-- | make/utilities.pm | 49 |
1 files changed, 15 insertions, 34 deletions
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\("(.+?)"\)/) |