Raman Gupta wrote:
> Joe Krahn wrote:
>>> From: Raman Gupta <[EMAIL PROTECTED]> - 2008-02-12 03:06
>>>
>>> Attachments: rsync_varsub.patch I patched Rsync.pm to do variable
>>> substitution for RsyncArgs. My use case for this is including an
>>> --exclude-from parameter with a host-specific exclude file, such
>>> as:
>> Instead of a special section to patch RsyncArgs, maybe the existing
>> Rsync*Cmd substations could just be done in a way that handles this. A
>> simple method would be to call &cmdVarSubstitute() twice. Another wayt
>> would be to modify that subroutine to allow recursive substitutions,
>> possibly with an enable/disable config flag.
> 
> Why? What is the advantage of doing it this way?
> 
> The only reason I can think of for this being a better approach is
> that the functionality is then available in the other config
> parameters that make up argList in Rsync*Cmd -- shareName,
> BackupFilesExclude, and BackupFilesOnly. However, the substitution
> functionality for these other parameters is probably of limited use.
> 
> Doing it directly to RsyncArgs keeps the logic simple, and the
> comments in the config file together with the config parameter. It
> accomplishes the "recursive subsitution" as you call it, without any
> complexity to the user (or in the code).
> 
> Cheers,
> Raman Gupta
> 
I was thinking of a more general fix, and perhaps keep the code a bit
simpler. I just looked at the handling of TarFullArgs and TarIncrArgs,
and realized that those already substitute variables in the arg list.
They work by appending args to the command array, then doing the
substitution once. So, even though it is not really useful to allow
substitution of all parameters, it may good to do it the same way for
RsyncArgs.

On the other hand, RsyncArgs also needs more work to keep the "don't
change" argument list separate from user args. Maybe the place where
separate RsyncArgs substitution is done could also be used to merge in
the "static" arg list, and check if there are any incompatible
arguments, like "--xattrs".

Joe Krahn

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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/

Reply via email to