Re: [exim] Dumping preprocessed Exim configuration (.ifdef's…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Heiko Schlittermann
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Dumping preprocessed Exim configuration (.ifdef's expanded)
Hi,

m.a.r.c.o@??? <m.a.r.c.o@???> (Do 15 Mai 2014 23:11:06 CEST):
> Ah, I bit the bullet and wrote this script:
>
> https://gist.github.com/anonymous/4ea45482121a2c1d8a6b
>
> It cut down my config from 700 to 350 lines. I did the rest,
> and now my configuration is only 70 lines long...


I've no knowledge about Ruby, but this isn't perfect:

    41:    lines = lines.join.gsub("\\\n", "{LINE_CONTINUATION}").each_line.to_a
    74:    lines.reject!{|line| line.match(/^\s*#/) }



According to the spec.txt the backslash doesn't need to be the very last
character on the line. And the comments should be removed at a very eary
stage.

| Any non-comment line can be continued by ending it with a backslash. Note that
| the general rule for white space means that trailing white space after the
| backslash and leading white space at the start of continuation lines is
| ignored. Comment lines beginning with # (but not empty lines) may appear in the
| middle of a sequence of continuation lines.


    this_option = foo \
        # some comment
        bar \               <-- trailing whitespace!
        baz


is perfectly legal. But your script will not parse it perfectly, I
believe. But I may be wrong. As always.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: 7CBF764A -
 gnupg fingerprint: 9288 F17D BBF9 9625 5ABC  285C 26A9 687E 7CBF 764A -
(gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B)-