steffen: server/perl-kolab/Kolab-Conf Conf.pm,1.2,1.3

cvs at intevation.de cvs at intevation.de
Fri Apr 16 13:58:37 CEST 2004


Author: steffen

Update of /kolabrepository/server/perl-kolab/Kolab-Conf
In directory doto:/tmp/cvs-serv23739/perl-kolab/Kolab-Conf

Modified Files:
	Conf.pm 
Log Message:
new @@@if blah@@@ syntax for templates, new attribute postfix-enable-virus-scan in schema and main.cf.template

Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab-Conf/Conf.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Conf.pm	31 Mar 2004 15:47:58 -0000	1.2
+++ Conf.pm	16 Apr 2004 11:58:35 -0000	1.3
@@ -79,16 +79,28 @@
         exit(1);
     }
 
+    my $skip = 0;
     while (<$template>) {
-        if (/\@{3}(\S+)\@{3}/) {
-            if ($Kolab::config{$1}) {
-                s/\@{3}(\S+)\@{3}/$Kolab::config{$1}/g;
-            } else {
-                Kolab::log('T', "No configuration variable corresponding to `$1' exists", KOLAB_WARN);
-                s/\@{3}(\S+)\@{3}//g;
-            }
+      if (/\@{3}if (\S+)\@{3}/) {
+	if ($Kolab::config{$1} && $Kolab::config{$1} ne "false" ) {
+          # Keep text
+	} else {
+          # Skip text
+          $skip++;
         }
-        print $config $_;
+        s/\@{3}if (\S+)\@{3}//;
+      } elsif (/\@{3}endif\@{3}/) {
+        ( $skip > 0 ) && $skip--;
+        s/\@{3}endif\@{3}//;
+      } elsif (/\@{3}(\S+)\@{3}/) {
+	if ($Kolab::config{$1}) {
+	  s/\@{3}(\S+)\@{3}/$Kolab::config{$1}/g;
+	} else {
+	  Kolab::log('T', "No configuration variable corresponding to `$1' exists", KOLAB_WARN);
+	  s/\@{3}(\S+)\@{3}//g;
+	}
+      }
+      ( $skip == 0 ) && print $config $_;
     }
 
     $template->close;





More information about the commits mailing list