On Tue, 2008-01-22 at 14:58 +0100, Rapha��l Pinson wrote:
> This bug is due to the way the parse_file sub returns.

Yep.

[...]
> This patch simply calls "next" instead of "return" when wget fails in
> parse_file. This way, wget errors are silently ignored and all files
> are downloaded.

Which is entirely the wrong fix, imo. Errors retrieving files shouldn't
be ignored.

dget already contains code that's intended to handle this situation. As
far as I can see, the problem is simply that the code in question
assumes that get_file() returns 0 for success, whereas it actually
returns 1.

I've committed a fix to svn for that:

Index: scripts/dget.pl
===================================================================
--- scripts/dget.pl     (revision 1011)
+++ scripts/dget.pl     (revision 1021)
@@ -134,7 +134,7 @@
 my %seen;
 sub get_file {
     my ($dir, $file, $md5sum) = @_;
-    return if $seen{$file};
+    return 1 if $seen{$file};
 
     if ($md5sum eq "unlink") {
        backup_or_unlink($file);

Regards,

Adam


Reply via email to