richard: server/kolabconf/lib/Kolab Conf.pm,1.16,1.17
cvs at kolab.org
cvs at kolab.org
Fri Aug 29 22:17:17 CEST 2008
Author: richard
Update of /kolabrepository/server/kolabconf/lib/Kolab
In directory doto:/tmp/cvs-serv1682/lib/Kolab
Modified Files:
Conf.pm
Log Message:
added code to support the conditional:
@@@if exists( /full/path/to/file )@@@ as proposed by Thomas
in kolab/issue3006
Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/kolabconf/lib/Kolab/Conf.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Conf.pm 27 Aug 2008 20:07:11 -0000 1.16
+++ Conf.pm 29 Aug 2008 20:17:14 -0000 1.17
@@ -139,7 +139,22 @@
}
$_ = <$template>;
}
- if (/\@{3}if (\S+?)\@{3}/) {
+
+ if (/\@{3}if exists\(\s*(\S+?)\s*\)\@{3}/) {
+ # @@@if exists(/full/path/to/file)@@@
+ # also possible: @@@if exists( /full/path/to/file )@@@
+ if (-f $1) {
+ # Keep text
+ $keep = 1;
+ } else {
+ # Skip text
+ $skip++;
+ $keep = 0;
+ }
+ } elsif (/\@{3}if (\S+?)\@{3}/) {
+ # @@@if some_variable@@@
+ # The some_variable is a key in the $Kolab::config hash and has
+ # its value set to either 'false' or 'true'
if ($Kolab::config{$1} && lc($Kolab::config{$1}) ne "false" ) {
# Keep text
$keep = 1;
More information about the commits
mailing list