Hi, Tony Shadwick wrote on 23.05.2007 at 09:34:05 [Re: [BackupPC-users] Should you have to patch BackupPC/Lib.pm?]: > Sure thing. This is what sub new() looks like in my Lib.pm:
I didn't take a close look at what you've changed, but as for ... > Also, I wound up cheating a bit, and did a symlink from > /usr/local/etc/BackupPC (correct for FreeBSD from ports) to > /etc/BackupPC. Originally I was having to either patch every call of > new() to be new(undef,undef,'/usr/local/etc/BackupPC',undef);, or in the > above line that reads: > > my($topDir, $installDir, $confDir, $noUserCheck) = @_; > > Somehow force that third value to be my real config directory. The > problem I ran into is that if I don't trigger useFHS, then it broke > convention by wanting the config directory to be $topDir/conf, ... shouldn't you simply change ... > sub new > { > my $class = shift; > my($topDir, $installDir, $confDir, $noUserCheck) = @_; > > # > # Whether to use filesystem hierarchy standard for file layout. > # If set, text config files are below /etc/BackupPC. > # > my $useFHS = 1; > my $paths; > > # > # Set defaults for $topDir and $installDir. > # > $topDir = '/data' if ( $topDir eq "" ); > $installDir = '/usr/local/BackupPC' if ( $installDir eq "" ); > > # > # Pick some initial defaults. For FHS the only critical > # path is the ConfDir, since we get everything else out > # of the main config file. > # > if ( $useFHS ) { > $paths = { > useFHS => $useFHS, > TopDir => $topDir, > InstallDir => $installDir, > ConfDir => $confDir eq "" ? '/etc/BackupPC' : $confDir, ConfDir => $confDir eq "" ? '/usr/local/etc/BackupPC' : $confDir, > LogDir => '/var/log/BackupPC', > }; > } else { > $paths = { > useFHS => $useFHS, > TopDir => $topDir, > InstallDir => $installDir, > ConfDir => $confDir eq "" ? "$topDir/conf" : $confDir, or, if you prefer, the same in this line ^^^^^^^^^^^^^^ > LogDir => "$topDir/log", (and then possibly change LogDir too) ? > }; > } } I don't really see much difference. BackupPC is supposed to be able to be installed in an FHS-conforming layout or a legacy layout for upgrades. Once you package it, you make a decision for one or the other (or even something completely different). You possibly have good reasons to change things, because your OS or distribution does things differently. If you need to do that, well, you need to do it. The least intrusive change is probably to simply change the default ConfDir. Coincidentally, this is what anyone using BackupPC needs to patch if they want to change ConfDir also for the toplevel configuration file ... Regards, Holger ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/backuppc-users http://backuppc.sourceforge.net/