The following code seems to imply that one can (optionally) set
TopDir, InstallDir, and ConfDir when initializing a new bpc class
sub new
{
my $class = shift;
my($topDir, $installDir, $confDir, $noUserCheck) = @_;
However, this doesn't really seem to have any effect in practice.
Specifically,
- If TopDir, InstallDir, or ConfDir *are* set in config.pl, then
the following code overrides the arguments given to 'sub new',
making the input arguments irrelevant.
foreach my $dir ( qw(TopDir ConfDir InstallDir LogDir RunDir) ) {
next if ( $bpc->{Conf}{$dir} eq "" );
$paths->{$dir} = $bpc->{$dir} = $bpc->{Conf}{$dir};
- Conversely, if TopDir, InstallDir, or ConfDir are *not* set in
config.pl, then $bpc->{Conf}{$dir} is never set causing any
routine that references $Conf{$dir} to fail
Suggested fix:
foreach my $dir ( qw(TopDir ConfDir InstallDir LogDir RunDir) ) {
if (( $bpc->{Conf}{$dir} eq "" ) ||
(defined($topDir) && $dir eq "TopDir") ||
(defined($confDir) && $dir eq "ConfDir") ||
(defined($installDir) && $dir eq "InstallDir"))
{
$bpc->{Conf}{$dir} = $bpc->{$dir};
} else
$bpc->{$dir} = $bpc->{Conf}{$dir};
}
$paths->{$dir} = $bpc->{$dir};
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/