X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FStorage%2FText.pm;h=d9be3c3aa36aff5e16238f3d0260833ad580c60e;hp=7c4f1f7bab429b42cd64858aea098c414df469ad;hb=9cf3998c4ef71332dea96ff3115daf8b9f722acb;hpb=fadae1eaa5482a441bc8e8aa829a063ee6a5f0c0 diff --git a/lib/BackupPC/Storage/Text.pm b/lib/BackupPC/Storage/Text.pm index 7c4f1f7..d9be3c3 100644 --- a/lib/BackupPC/Storage/Text.pm +++ b/lib/BackupPC/Storage/Text.pm @@ -12,7 +12,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2004 Craig Barratt +# Copyright (C) 2004-2009 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.1.0beta0, released 3 Sep 2007. +# Version 3.2.0beta0, released 5 April 2009. # # See http://backuppc.sourceforge.net. # @@ -214,7 +214,10 @@ sub TextFileWrite (my $dir = $file) =~ s{(.+)/(.+)}{$1}; - mkpath($dir, 0, 0775) if ( !-d $dir ); + if ( !-d $dir ) { + eval { mkpath($dir, 0, 0775) }; + return "TextFileWrite: can't create directory $dir" if ( $@ ); + } if ( open(FD, ">", "$file.new") ) { binmode(FD); print FD $contents; @@ -319,11 +322,6 @@ sub ConfigDataRead delete($conf->{BlackoutWeekDays}); } - # - # Make sure IncrLevels is defined - # - $conf->{IncrLevels} = [1] if ( !defined($conf->{IncrLevels}) ); - return (undef, $conf); }