Am Donnerstag, 17. Oktober 2013, 12:55:18 schrieb Andrea Urbani:
Hi,
first of all I'm sorry: I was not subscribed to the bug-wget list so I saw
only yesterday the replies of other users.
Well, this patch replaces the previous ones from me.
Now wget, after the SYST command, looks if it knows that system.
If yes, wget will force the use of LIST or LIST -a.
If no, wget will try, only the first time of each session, before the
LIST -a command and after the LIST.
If LIST -a works and returns more or equal data of the LIST,
LIST -a will be the standard list command for all the session.
If LIST -a fails or returns less data than LIST (think on the case
of an existing file called -a), LIST will be the standard list
command for all the session.
Well, there is an unhandled situation (that I will not fix, at least
now): I'm on an unknown system that recognise LIST -a as give me the
-a files/folders, I have to download files from different folders and
the starting ftp folder contains only one -a folder and no . and
.. folders are returned ! :-O)
In this case wget will try LIST -a then LIST. The result will be
the same so LIST -a will be taken, but, as soon as wget will go
inside the -a folder, the problems will begin...
About the look for known systems I force LIST when the system is ST_VMS or
exactly 215 UNIX MultiNet Unix Emulation V5.3(93). If the system is like
215 UNIX Type: L8 I force LIST -a.
In all the other systems, I try LIST -a and after LIST (only the first
time). I don't force LIST for ST_WINNT because in ftp-ls.c is written,
inside ftp_parse_ls,
/* Detect whether the listing is simulating the UNIX format */
so there are strange situations there, that I can't test.
About MultiNet I have written to the developers to know if I can check a
more general 215 UNIX MultiNet or not.
I have tested the sites:
ftp://ftp.info-zip.org/
ftp://ftp.freebsd.org/
ftp://antinode.info/moz_test/
ftp://ftp.microsoft.com/
ftp://ftp.adobe.com/
ftp://ftp.gnu.org/
ftp://ftp.ncftp.com/
I have also added the following test cases:
* Test-ftp-list-Multinet.px: Test LIST on a UNIX MultiNet
Unix Emulation system that returns an empty content when
LIST -a is requested (probably because no -a files
exist)
* Test-ftp-list-Unknown.px: Test LIST on a Unknown ftp
service system that returns an empty content when
LIST -a is requested (probably because no -a files
exist)
* Test-ftp-list-Unknown-a.px: Test LIST on a Unknown ftp
service system that recognises LIST -a as give me the
-a file and there is a -a file + other two files.
LIST -a will return only -a, LIST all the three files.
* Test-ftp-list-Unknown-hidden.px: Test LIST on a Unknown ftp
service system that recognises LIST -a as an UNIX Type:
L8 system (show me also the hidden files) and there is an
hidden file.
* Test-ftp-list-Unknown-list-a-fails.px: Test LIST on a
Unknown ftp service system that raises an error on
LIST -a command.
* Test-ftp-list-UNIX-hidden.px: Test LIST on a UNIX Type:
L8 system that recognises LIST -a as show me also the
hidden files and there is an hidden file.
Everything should be ok. If not, let me know. (Now I'm subscribed to
bug-wget)
Hey Andrea,
nice work.
But I just can't apply your patch to up-to-date Wget sources (patch throws
messages at me and thereafter Wget is not compilable at all).
Maybe you can commit all your changes locally and create a patch with
git format-patch -1
?
Regards, Tim
signature.asc
Description: This is a digitally signed message part.