Hi list,
while updating a wiki page on changing TopDir I stumbled across the following
observation: in lines 155/156, BackupPC::Lib sets the object member variables
PoolDir and CPoolDir relative to TopDir *before* reading the config file and
allowing overriding TopDir, effectively exempting those two paths from an
alternate TopDir setting (which obviously does not work if $TopDir is on a
different FS, and if it's not, it's hardly intended behaviour :). I believe
these two lines should be moved before line 169 (currently), i.e. after
updating the paths from the config file settings, before the call to
setPaths() [or after that call, doesn't seem to matter].
diff attached - in case it helps.
I believe that should allow overriding TopDir without patching Lib.pm in both
useFHS and non-useFHS cases (but I haven't tested - sorry).
Regards,
Holger
--- Lib.pm 2007-11-26 04:00:07.000000000 +0100
+++ /tmp/Lib.pm 2008-08-08 05:23:25.000000000 +0200
@@ -152,8 +152,6 @@
# Clean up %ENV and setup other variables.
#
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
- $bpc->{PoolDir} = "$bpc->{TopDir}/pool";
- $bpc->{CPoolDir} = "$bpc->{TopDir}/cpool";
if ( defined(my $error = $bpc->ConfigRead()) ) {
print(STDERR $error, "\n");
return;
@@ -166,6 +164,8 @@
next if ( $bpc->{Conf}{$dir} eq "" );
$paths->{$dir} = $bpc->{$dir} = $bpc->{Conf}{$dir};
}
+ $bpc->{PoolDir} = "$bpc->{TopDir}/pool";
+ $bpc->{CPoolDir} = "$bpc->{TopDir}/cpool";
$bpc->{storage}->setPaths($paths);
#
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-devel mailing list
BackupPC-devel@lists.sourceforge.net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-devel
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/