[Limacute-commit] r56 - trunk/RPM/SRC/squirrelmail
limacute at projects.linpro.no
limacute at projects.linpro.no
Tue Jan 9 11:21:05 CET 2007
Author: limacute
Date: 2007-01-09 11:21:05 +0100 (Tue, 09 Jan 2007)
New Revision: 56
Added:
trunk/RPM/SRC/squirrelmail/squirrelmail.patch.squirrelconf
Log:
Added patch to make squirrelconf use config.template instead of actual configuration file
Added: trunk/RPM/SRC/squirrelmail/squirrelmail.patch.squirrelconf
===================================================================
--- trunk/RPM/SRC/squirrelmail/squirrelmail.patch.squirrelconf 2007-01-09 10:20:39 UTC (rev 55)
+++ trunk/RPM/SRC/squirrelmail/squirrelmail.patch.squirrelconf 2007-01-09 10:21:05 UTC (rev 56)
@@ -0,0 +1,76 @@
+Index: bin/squirrelconf
+diff -Nau bin/squirrelconf.orig bin/squirrelconf
+--- bin/squirrelconf.orig 2007-01-08 17:14:05.000000000 +0100
++++ bin/squirrelconf 2007-01-09 11:07:10.000000000 +0100
+@@ -19,7 +19,7 @@
+ my $dir;
+ if ( eval q{require "File/Basename.pm"} ) {
+ $dir = File::Basename::dirname($0);
+- chdir("/kolab/etc/squirrelmail");
++ chdir("/kolab/etc/kolab/templates");
+ }
+
+ ############################################################
+@@ -45,9 +45,9 @@
+ ############################################################
+ # First, lets read in the data already in there...
+ ############################################################
+-if ( -e "config.php" ) {
++if ( -e "squirrelmail.config.template" ) {
+ # Make sure that file is readable
+- if (! -r "config.php") {
++ if (! -r "squirrelmail.config.template") {
+ clear_screen();
+ print "WARNING:\n";
+ print "The file \"config/config.php\" was found, but you don't\n";
+@@ -57,7 +57,7 @@
+ $ctu = <STDIN>;
+ exit;
+ }
+- open( FILE, "config.php" );
++ open( FILE, "squirrelmail.config.template" );
+ while ( $line = <FILE> ) {
+ $line =~ s/^\s+//;
+ $line =~ s/^\$//;
+@@ -108,7 +108,7 @@
+ }
+
+ $config = 1;
+- open( FILE, "config.php" );
++ open( FILE, "squirrelmail.config.template" );
+ } elsif ( -e "config_default.php" ) {
+ open( FILE, "config_default.php" );
+ while ( $line = <FILE> ) {
+@@ -168,9 +168,22 @@
+ exit;
+ }
+
++my @kolab_meta_data=();
++my $kolab_meta_done=0;
++
+ # Read and parse the current configuration file
+ # (either config.php or config_default.php).
+ while ( $line = <FILE> ) {
++ # Provision for KOLAB meta data; occurs before <?php in squirrelmail.config.template
++ if (not $kolab_meta_done) {
++ if ($line =~ /^\s*\<\?php/) {
++ $kolab_meta_done = 1;
++ }
++ else {
++ push(@kolab_meta_data, $line);
++ }
++ }
++
+ $line =~ s/^\s+//;
+ $line =~ s/^\$//;
+ $var = $line;
+@@ -3040,7 +3053,8 @@
+
+ sub save_data {
+ $tab = " ";
+- if ( open( CF, ">config.php" ) ) {
++ if ( open( CF, ">squirrelmail.config.template" ) ) {
++ print CF @kolab_meta_data if @kolab_meta_data;
+ print CF "<?php\n";
+ print CF "\n";
+
More information about the Limacute-commit
mailing list