X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FStorage%2FText.pm;fp=lib%2FBackupPC%2FStorage%2FText.pm;h=4f63417860ddb2a52f28f04f607b6e450616a2a1;hp=421310692ba13da8418ebf44f8bc607b1f101982;hb=4cdaa6b8a9f5161ee2da4371d68cbbad41248ea0;hpb=dcb39df8e33e09eabfb4eae471c2e6447094d0e2 diff --git a/lib/BackupPC/Storage/Text.pm b/lib/BackupPC/Storage/Text.pm index 4213106..4f63417 100644 --- a/lib/BackupPC/Storage/Text.pm +++ b/lib/BackupPC/Storage/Text.pm @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0alpha, released 23 Jan 2006. +# Version 3.0.0beta0, released 11 Jul 2006. # # See http://backuppc.sourceforge.net. # @@ -247,11 +247,13 @@ sub ConfigPath return "$s->{ConfDir}/config.pl" if ( !defined($host) ); if ( $s->{useFHS} ) { - return "$s->{ConfDir}/host/$host.pl"; + return "$s->{ConfDir}/pc/$host.pl"; } else { + return "$s->{TopDir}/pc/$host/config.pl" + if ( -f "$s->{TopDir}/pc/$host/config.pl" ); return "$s->{ConfDir}/$host.pl" if ( $host ne "config" && -f "$s->{ConfDir}/$host.pl" ); - return "$s->{TopDir}/pc/$host/config.pl"; + return "$s->{ConfDir}/pc/$host.pl"; } } @@ -287,6 +289,23 @@ sub ConfigDataRead $conf->{$param} = { "*" => $conf->{$param} }; } + # + # Handle backward compatibility with defunct BlackoutHourBegin, + # BlackoutHourEnd, and BlackoutWeekDays parameters. + # + if ( defined($conf->{BlackoutHourBegin}) ) { + push(@{$conf->{BlackoutPeriods}}, + { + hourBegin => $conf->{BlackoutHourBegin}, + hourEnd => $conf->{BlackoutHourEnd}, + weekDays => $conf->{BlackoutWeekDays}, + } + ); + delete($conf->{BlackoutHourBegin}); + delete($conf->{BlackoutHourEnd}); + delete($conf->{BlackoutWeekDays}); + } + return (undef, $conf); }