On Mon, Sep 14, 2015 at 2:52 PM, George Nassiopoulos
<gnassiopoulos@cfa.harvard.edu> wrote:
Show quoted text> On Mon, Sep 14, 2015 at 2:36 PM, Lee Eakin via RT
> <bug-File-Rsync@rt.cpan.org> wrote:
>> <URL:
https://rt.cpan.org/Ticket/Display.html?id=107063 >
>>
>> George,
>> Do you have a specific code sample where this is failing? It seems to
>> be working properly in my tests.
>>
>> Note that rsync-path is an rsync option to tell the remote end where to
>> find the rsync binary and path-to-rsync is a File::Rsync option to tell
>> perl where to find the rsync binary on the local system, overriding the
>> normal PATH lookup.
>>
>> Also, version 0.46 has a bug parsing hash references that could be
>> causing a problem. I have 0.47 staged for release to fix it.
>> You can pull the pre-released version here for testing:
>>
http://www.japh.net/File-Rsync-0.47.tar.gz
>> -Lee
>
>
> Hi Lee,
>
> My apologies. I wasn't aware of the distinction between rsync-path and
> path-to-rsync. The perl script i'm running has always
> done an rsync from a local src filesystem (solaris or linux) to a local
> NFS mounted dst filesystem. I had been using new->('rsync-path' ...
> call and the perl script was able to find the proper executable to
> run up until v4.3. I can try to condense the script I have down to a few
> lines to see if I can replicate the issue. For what it's worth, I upgraded
> to v.46 when I also installed perl5.20.2. I don't know if there are any
> funny interactions because of the perl version I'm using.
>
> Thanks for your reply and your time. If I can successfully condense the
> problem down to a few lines I'll pass it along to you. At some point I
> want to see if v.47 works.
>
> --
> George E. Nassiopoulos
> gnassiopoulos@cfa.harvard.edu
Hello again Lee,
Here is a short program that uses perl5.20.2 and calls File::Rsync v0.46:
###########################################
#!/opt/bin/perl5.20.2/perl -w
#
use strict;
use Fcntl;
use File::Rsync;
use vars qw( %rsync_control ) ;
my $src_dir = "/tmp/A/" ; my $dst_dir = "/tmp/B" ;
$rsync_control{ "rsync_defaults" } = [
"archive" => 1,
] ;
my $rsync_obj = File::Rsync->new(
@{ $rsync_control { rsync_defaults } } ,
'rsync-path' => "/opt/bin/rsync" ,
) ;
$rsync_obj->exec( "src" => $src_dir , "dst" => $dst_dir , ) ;
my $command_used = $rsync_obj->lastcmd;
print STDERR "$command_used\n" ;
###########################################
When I run the script I get:
e.g. 1 % ./t_perl5.20.2_v46.pl
rsync --archive --rsync-path=/opt/bin/rsync /tmp/A/ /tmp/B
If I change only the version of perl that the script runs to
perl5.16.3 install (which has File::Rsync v0.43 installed) I get:
e.g. 2 % ./t_perl5.16.3_v43.pl
/opt/bin/rsync --archive --rsync-path=/opt/bin/rsync /tmp/A/ /tmp/B
If I call new with 'path-to-rsync' I get:
e.g. 3 % ./t_perl5.20.2_v46.pl
/opt/bin/rsync --archive /tmp/A/ /tmp/B
e.g. 4 % ./t_perl5.16.3_v43.pl
/opt/bin/rsync --archive /tmp/A/ /tmp/B
If I read your initial email to me correctly, it almost sounds as if the
v0.43 behaviour I got used to using is not intended and contrary to
documentation and I should have been using both rsync-path and
path-to-rsync all along ? I apologize for my confusion.
--
George E. Nassiopoulos
gnassiopoulos@cfa.harvard.edu