Dear Lee,
unfortunately the last fix (release 0.49) doesn't work properly.
There is a problem with end of lines after each file in the list...
Look at this example. It differs from the previous only in count of files (now 2) and output section:
#!/usr/bin/perl
use File::Rsync;
sub infun {
print "test.file\ntest2.file";
}
my $rs = File::Rsync->new( {
'recursive' => 1,
'links' => 1,
'copy-unsafe-links' => 1,
'perms' => 1,
'times' => 1,
'group' => 1,
'owner' => 1,
'verbose' => 1,
'update' => 1,
'stats' => 1,
'whole-file' => 1,
'rsh' => '/usr/bin/rsh',
'errfun' => \&out
} );
sub out {
my $msg = shift;
print $msg;
}
$rs->exec( { src => 'src',
dest => 'dest',
'files-from' => '-',
infun => \&infun } );
test steps in bash:
0) test_rsync_fail.pl is in actual directory
1) mkdir src dest
2) echo "test" > /src/test.file
3) echo "test" > /src/test2.file
4) perl test_rsync_fail.pl
It generates this error:
rsync: link_stat "/tmp/src/test.filetest2.file" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.0]
It seems, that EOL "\n" is lost.
This was working as expected in version 0.45
Please take a look on it.
Kind regards,
Michal
Show quoted text-----Original Message-----
From: Eakin, Lee via RT [mailto:bug-File-Rsync@rt.cpan.org]
Sent: Thursday, March 10, 2016 4:54 PM
To: Krupicka, Michal (FIE) <Michal.Krupicka@skoda-auto.cz>
Subject: Re: [rt.cpan.org #112853] Bug in perl-File-Rsync-0.48-40.1.noarch
<URL:
https://rt.cpan.org/Ticket/Display.html?id=112853 >
Glad I could get it fixed quickly for you (and everyone else who didn't report it yet ;). I'll post it to CPAN and close the bug report.
Thanks again for reporting it.
-Lee
> Date: Thu, 10 Mar 2016 10:10:23 -0500
> From: "Krupicka, Michal via RT" <bug-File-Rsync@rt.cpan.org>
> To: undisclosed-recipients: ;
> Subject: RE: [rt.cpan.org #112853] Bug in
> perl-File-Rsync-0.48-40.1.noarch
>
> Queue: File-Rsync
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=112853 >
>
> Lee,
>
> thank you very much for the fix and also that the issue was resolved
> so quickly:-) I have tested it in my environment and the fix is OK. No problem with Changelog.
>
> Thanks again for your time and willingness.
>
> Kind regards,
> Michal
>
>
> -----Original Message-----
> From: Eakin, Lee via RT [mailto:bug-File-Rsync@rt.cpan.org]
> Sent: Thursday, March 10, 2016 3:16 PM
> To: Krupicka, Michal (FIE) <Michal.Krupicka@skoda-auto.cz>
> Subject: Re: [rt.cpan.org #112853] Bug in
> perl-File-Rsync-0.48-40.1.noarch
>
> <URL:
https://rt.cpan.org/Ticket/Display.html?id=112853 >
>
> Michal,
> Thanks for catching this! I see how I broke it during the re-design
> at
> 0.46 (not reading my own documentation was a big part of it). Sorry if it caused you much trouble.
>
> Can you check out
http://www.japh.net/File-Rsync-0.49.tar.gz before I release it and make sure it fixes your code, and check out the top of Changelog and let me know if you are OK with the attribution? I want to give proper credit, but also respect everyone's privacy.
>
> I fixed my infun test case, but I'd like a second test and eyes before posting the new version.
> -Lee
>
> > Date: Wed, 9 Mar 2016 05:17:58 -0500
> > From: "Krupicka, Michal via RT" <bug-File-Rsync@rt.cpan.org>
> > To: undisclosed-recipients: ;
> > Subject: [rt.cpan.org #112853] Bug in
> > perl-File-Rsync-0.48-40.1.noarch
> >
> > Wed Mar 09 05:17:57 2016: Request 112853 was acted upon.
> > Transaction: Ticket created by Michal.Krupicka@skoda-auto.cz
> > Queue: File-Rsync
> > Subject: Bug in perl-File-Rsync-0.48-40.1.noarch
> > Broken in: (no value)
> > Severity: (no value)
> > Owner: Nobody
> > Requestors: Michal.Krupicka@skoda-auto.cz
> > Status: new
> > Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=112853 >
> >
> >
> > Dear File-Rsync developers,
> >
> > I would like to report a bug in this module.
> >
> > File-Rsync-0.48 hangs in forever loop if you use infun parametr which aims to a function which generates a list of files to be transferred.
> >
> > Here is a small perl source code of test_rsync_fail.pl (needed in test steps bellow):
> >
> > #!/usr/bin/perl
> >
> > use File::Rsync;
> >
> > sub infun {
> >
> > print "test.file";
> > }
> >
> > my $rs = File::Rsync->new( {
> > 'recursive' => 1,
> > 'links' => 1,
> > 'copy-unsafe-links' => 1,
> > 'perms' => 1,
> > 'times' => 1,
> > 'group' => 1,
> > 'owner' => 1,
> > 'verbose' => 1,
> > 'update' => 1,
> > 'stats' => 1,
> > 'whole-file' => 1,
> > 'rsh' => '/usr/bin/rsh',
> > } );
> >
> > $rs->exec( { src => 'src',
> > dest => 'dest',
> > 'files-from' => '-',
> > infun => \&infun } );
> >
> >
> > test steps in bash:
> > 0) test_rsync_fail.pl is in actual directory
> > 1) mkdir src dest
> > 2) echo "test" > /src/test.file
> > 3) perl test_rsync_fail.pl
> >
> > observation in File-Rsync-0.45:
> > it works a s expected, directory ./dest contains one file "test.file"
> >
> > observation in File-Rsync-0.48:
> > output is filled up with neverending string "test.file test.file test.file test.file test.file test.file test.file ......"
> > it cycles forever
> >
> > My environment:
> > kernel 3.12.28-4-default
> > rsync-3.1.0-2.7.x86_64
> > perl-File-Rsync-0.48-40.1.noarch
> > perl-5.18.2-3.7.x86_64
> >
> >
> >
> >
> > Thank you for your time
> > Kind regards
> > Michal Krupicka
> >
> >
>