bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Unexpected Return Code


From: Micah Cowan
Subject: Re: [Bug-wget] Unexpected Return Code
Date: Mon, 03 Nov 2008 14:34:05 -0800
User-agent: Thunderbird 2.0.0.17 (X11/20080914)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian G. Merrell wrote:
> Hello,
> 
> wget -nv -r --accept=rpm -np -nd -l1 http://www.google.com/foo
> 
> Running the above command, wget says there was a 404 error, which is
> expected, but wget also returns 0.  Is this expected behavior or a
> bug?
> 
> For what it's worth, wget http://www.google.com/foo also prints a
> 404 error message, but returns 1.

Brian also asked this in IRC; I mentioned that I believed that this may
have been fixed, either in 1.11.4 or the current dev sources, but only
for URLs specified on the command-line, and not those obtained via
recursion, since it's not entirely clear what Wget should do in that event.

Hm, on checking, it appears that's wrong, and retrieve_tree() returns
RETROK except when there's a write error or some such. I must have been
thinking of the patch jff submitted, which is seen here:
https://savannah.gnu.org/bugs/index.php?23348

Looking at it, though, I think that will just use the status from the
most recent attempt. We probably need something that just returns the
status code from the _original_ URL (which came from either the command
line or an input file).

Anyway, Brian, Wget's lack of proper exit statuses is a known issue,
currently tracked at the link above, and slated for the 1.12 release. It
may be that jff's patch there is what you need.

As for what Wget should do with 404s in "deep" links, I'll probably keep
Wget returning statuses for user-specified URLs only (once it's actually
doing that), and use the proposed SIDB feature
(http://wget.addictivecode.org/FeatureSpecifications/SessionInfoDataBase)
to find the statuses for particular URLs (when we get around to writing
that).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJD3xd7M8hyUobTrERAivCAJ9HxwCvhAGraBEb++vDYY/ld2vu/ACfdYg9
klnW0bGc5zqorDpSGr0ky2k=
=LAYK
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]