Add new option --keep-badhash to keep Metalink's files with a bad hash

* src/init.c: Add keepbadhash
* src/main.c: Add keep-badhash
* src/options.h: Add keep_badhash
* doc/wget.texi: Add docs for --keep-badhash
* src/metalink.h: Add prototypes badhash_suffix(), badhash_or_remove()
* src/metalink.c: New functions badhash_suffix(), badhash_or_remove().
  (retrieve_from_metalink): Call badhash_or_remove() on download error

With --keep-badhash, append .badhash to Metalink's files with checksum
mismatch. (retrieve_from_metalink): unique_create() may append another
suffix to avoid overwriting existing files.

Without --keep-badhash, remove downloaded files with checksum mismatch
(this conforms to the old behaviour).
This commit is contained in:
Matthew White
2016-07-28 20:21:48 +02:00
committed by Tim Rühsen
parent 7fad76db4c
commit 943a6d585f
6 changed files with 67 additions and 7 deletions

View File

@@ -512,6 +512,12 @@ href if none was specified.
Downloads files covered in local Metalink @var{file}. Metalink version 3
and 4 are supported.
@cindex keep-badhash
@item --keep-badhash
Keeps downloaded Metalink's files with a bad hash. It appends .badhash
to the name of Metalink's files which have a checksum mismatch, except
without overwriting existing files.
@cindex metalink-over-http
@item --metalink-over-http
Issues HTTP HEAD request instead of GET and extracts Metalink metadata