3.1.0 changes:
[BackupPC.git] / lib / BackupPC / Lib.pm
index 3a8cf18..3e320ba 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -72,7 +72,20 @@ require DynaLoader;
 
 BEGIN {
     eval "use IO::Dirent qw( readdirent DT_DIR );";
-    $IODirentOk = 1 if ( !$@ );
+    if ( !$@ && opendir(my $fh, ".") ) {
+        #
+        # Make sure the IO::Dirent really works - some installs
+        # on certain file systems don't return a valid type.
+        #
+        my $dt_dir = eval("DT_DIR");
+        foreach my $e ( readdirent($fh) ) {
+            if ( $e->{name} eq "." && $e->{type} == $dt_dir ) {
+                $IODirentOk = 1;
+                last;
+            }
+        }
+        closedir($fh);
+    }
 };
 
 #
@@ -130,7 +143,7 @@ sub new
 
     my $bpc = bless {
        %$paths,
-        Version => '3.1.0beta0',
+        Version => '3.1.0',
     }, $class;
 
     $bpc->{storage} = BackupPC::Storage->new($paths);
@@ -396,6 +409,12 @@ sub ConfigRead
        return $mesg;
     }
     $bpc->{Lang} = \%Lang;
+
+    #
+    # Make sure IncrLevels is defined
+    #
+    $bpc->{Conf}{IncrLevels} = [1] if ( !defined($bpc->{Conf}{IncrLevels}) );
+
     return;
 }