stephan: devel/kolab/Kolab Conf.pm,1.1.1.1,1.2

cvs at intevation.de cvs at intevation.de
Tue May 11 12:05:06 CEST 2004


Author: stephan

Update of /kolabrepository/devel/kolab/Kolab
In directory doto:/tmp/cvs-serv16008/Kolab

Modified Files:
	Conf.pm 
Log Message:
Conf.pm now handles non-existant original config files gracefully.
Conf.pm template <-> config logic improved, should now handle any change
Conf.pm should not produce unnecesarry warnings with kolabconf anymore.


Index: Conf.pm
===================================================================
RCS file: /kolabrepository/devel/kolab/Kolab/Conf.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Conf.pm	3 May 2004 14:04:04 -0000	1.1.1.1
+++ Conf.pm	11 May 2004 10:05:04 -0000	1.2
@@ -81,20 +81,26 @@
     }
     $TEMPLATE->close;
 
+    my $configchanged = 0;
     my $CONFIGFILE;
     if (!($CONFIGFILE = IO::File->new($cfg, 'r'))) {
         Kolab::log('T', "Unable to open config file `$cfg'", KOLAB_ERROR);
-        exit(1);
-    }
-
-    my $configchanged = 0;
+        $configchanged = 1;	
+    } else {
+     
+       my @configfile = <$CONFIGFILE>;
+       $CONFIGFILE->close;
+       undef $CONFIGFILE;
 
-    foreach my $line (@tempfile) {
-      my $configline = <$CONFIGFILE>;
-      $configchanged = 1 if ($configline ne $line)
+       if ($#configfile == $#tempfile) {
+          foreach my $line (@tempfile) {
+            my $configline = shift(@configfile);
+            $configchanged = 1 if ($configline ne $line)
+          }
+       } else {
+          $configchanged = 1;
+       }
     }
-    $CONFIGFILE->close;
-    undef $CONFIGFILE;
 
     return 0 if ($configchanged ne 1);
 





More information about the commits mailing list