mathieu: server/perl-kolab/lib/Kolab Conf.pm,1.16,1.17
cvs at kolab.org
cvs at kolab.org
Sun Dec 13 20:48:28 CET 2009
Author: mathieu
Update of /kolabrepository/server/perl-kolab/lib/Kolab
In directory doto:/tmp/cvs-serv29641/perl-kolab/lib/Kolab
Modified Files:
Conf.pm
Log Message:
Added arguments to rebuildTemplates(): dorunonchange and templates.
Use those in kolab_bootstrap (in replacement of bootstrapConfig()).
Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/lib/Kolab/Conf.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Conf.pm 13 Dec 2009 18:27:08 -0000 1.16
+++ Conf.pm 13 Dec 2009 19:48:26 -0000 1.17
@@ -597,6 +597,8 @@
{
my %args = @_;
$args{doreload} = 1 if !exists $args{doreload};
+ $args{dorunonchange} = 1 if !exists $args{dorunonchange};
+ #$args{templates} = ALL if !exists $args{templates};
my $key;
my $value;
@@ -610,15 +612,22 @@
Kolab::log('T', 'Loading meta-template data', KOLAB_DEBUG );
loadMetaTemplates( $templatedir, \%templates, \%permissions, \%ownership, \%runonchange, \%commentchar );
+ # defaults to all templates
+ $args{templates} = [ keys %templates ] if !exists $args{templates};
my $cfg;
my $tpl;
- foreach $tpl (keys %templates) {
+ foreach $tpl (@{$args{templates}}) {
$cfg = $templates{$tpl};
build($tpl, $cfg, $ownership{$cfg}, $permissions{$cfg}, $commentchar{$cfg});
}
Kolab::log('T', 'Finished regenerating configuration files', KOLAB_DEBUG );
+ if(!$args{dorunonchange}) {
+ Kolab::log('T', 'RUNONCHANGE will not be executed, as requested.', KOLAB_DEBUG );
+ return;
+ }
+
my %cmds = ();
foreach $key (keys %runonchange) {
if (defined $confighaschanged{$key}) {
@@ -640,28 +649,6 @@
} else {
Kolab::log('T', 'Reload not allowed, not executing command: '.$cmd, KOLAB_DEBUG );
}
- }
-}
-
-sub bootstrapConfig
-{
- my $templatedir = $Kolab::config{"templatedir"};
-
- # FIXME: it would be better if the templates can be given as an
- # argument to this function.
- my @templ = ("$templatedir/slapd.access.template",
- "$templatedir/slapd.conf.template",
- "$templatedir/slapd.replicas.template");
-
- my %runonchange;
-
- loadMetaTemplates( $templatedir, \%templates, \%permissions, \%ownership, \%runonchange, \%commentchar );
-
- my $cfg;
- my $out;
- foreach my $tpl (@templ) {
- $cfg = $templates{$tpl};
- build($tpl, $cfg, $ownership{$cfg}, $permissions{$cfg}, $commentchar{$cfg});
}
}
More information about the commits
mailing list