This mail is mostly a note to myself in a safe place!

On 08/05/2007, Alex Owen <[EMAIL PROTECTED]> wrote:
> On 06/05/07, Joey Hess <[EMAIL PROTECTED]> wrote:
> > Alex Owen wrote:
> > > +             elif    grep "server returned error 404" $log >/dev/null ; 
> > > then
> >
> > It's generally not a good idea to rely on command error messages like
> > this.
>
> I agree,
> I was thinking that getting wget to give a sensible exit status rather
> than parsing the error message. Perhaps that warrents a wishlist bug
> on wget?

I have posted to GNU-wget mailing list:
 http://www.mail-archive.com/wget%40sunsite.dk/msg10259.html

proposing wget exits with exit status 4  for 404 errors

Attached is an untested patch to busybox wget to implement an exit
status of 4 for 404 errors.

That is all for this update!
Alex Owen
--- networking/wget.c	2006-04-16 17:27:46.000000000 +0100
+++ networking/wget.c.rao	2007-09-13 21:36:44.000000000 +0100
@@ -372,6 +372,11 @@
 				case 302:
 				case 303:
 					break;
+				case 404:
+					bb_default_error_retval = 4;
+					chomp(buf);
+                                        close_delete_and_die("server returned error %d: %s", atoi(s), buf);
+					/*Never gets here*/
 				case 206:
 					if (do_continue)
 						break;

Reply via email to