On Thu, Aug 04, 2005 at 06:22:07PM -0400, Spectre _ wrote:
> Total: 2 directories, 16 files, 0 symlinks
> To be removed: 1 directory, 0 files, 0 symlinks
> Retrying mirror...
Probably you have specified --loop option without -e option.
There is a bug in lftp mirror with that. Here is a patch to fix the problem.
--
Alexander.
Index: MirrorJob.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/MirrorJob.cc,v
retrieving revision 1.125
diff -u -p -r1.125 MirrorJob.cc
--- MirrorJob.cc 18 Jul 2005 12:58:47 -0000 1.125
+++ MirrorJob.cc 5 Aug 2005 08:05:39 -0000
@@ -962,7 +962,7 @@ int MirrorJob::Do()
parent_mirror->stats.Add(stats);
else
{
- if((flags&LOOP) && stats.HaveSomethingDone() && !stats.error_count)
+ if((flags&LOOP) && stats.HaveSomethingDone(flags) &&
!stats.error_count)
{
set_state(DONE);
PrintStatus(0,"");
@@ -1183,9 +1183,10 @@ void MirrorJob::Statistics::Add(const St
bytes +=s.bytes;
time +=s.time;
}
-bool MirrorJob::Statistics::HaveSomethingDone()
+bool MirrorJob::Statistics::HaveSomethingDone(int flags)
{
- return
new_files|mod_files|del_files|new_symlinks|mod_symlinks|del_symlinks|del_dirs;
+ bool del=(flags&MirrorJob::DELETE);
+ return
new_files|mod_files|(del_files*del)|new_symlinks|mod_symlinks|(del_symlinks*del)|(del_dirs*del);
}
char *MirrorJob::SetScriptFile(const char *n)
Index: MirrorJob.h
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/MirrorJob.h,v
retrieving revision 1.41
diff -u -p -r1.41 MirrorJob.h
--- MirrorJob.h 5 Apr 2005 09:49:41 -0000 1.41
+++ MirrorJob.h 5 Aug 2005 08:05:51 -0000
@@ -85,7 +85,7 @@ class MirrorJob : public Job
Statistics();
void Reset();
void Add(const Statistics &);
- bool HaveSomethingDone();
+ bool HaveSomethingDone(int);
};
Statistics stats;