Bug 328521 - Wget does not return proper exit status when using -r or --mirror
Wget does not return proper exit status when using -r or --mirror
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: wget (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-11 17:05 EDT by Victor Gregorio
Modified: 2008-01-22 08:57 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-22 08:57:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 328441 None None None Never

  None (edit)
Description Victor Gregorio 2007-10-11 17:05:21 EDT
+++ This bug was initially created as a clone of Bug #328441 +++

Description of problem:

If wget is used with -r or --mirror, the exit status is always 0.  
Even is there is an error.

Version-Release number of selected component (if applicable):

Fedora release 7 (Moonshine)
Wget RPM: wget-1.10.2-15.fc7.src.rpm
Wget Version: GNU Wget 1.10.2 (Red Hat modified)

How reproducible:

Bug occurs every time a wget with -r or --mirror results in 'Connection
refused', a 404 Error or a 401 Error.

Steps to Reproduce:

1. Assuming no HTTP server is running on localhost.localdomain port 80...

2. wget --quiet http://localhost.localdomain/ ; echo "Exit status: $?"
Exit status: 1

3. wget -r --quiet http://localhost.localdomain/ ; echo "Exit status: $?"
Exit status: 0

4. wget --mirror --quiet http://localhost.localdomain/ ; echo "Exit status: $?"
Exit status: 0

Additional info:

Also seen on RedHat RHAS 4u5 x86_64
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
wget-1.10.2-0.40E -- GNU Wget 1.10.2 (Red Hat modified)
Comment 1 Karsten Hopp 2008-01-22 08:57:02 EST
This is related to the exit status discussion at
http://www.mail-archive.com/wget@sunsite.dk/msg10655.html

- The first attempt is trying to download a single file (the index file). This is
  no available -> failure
- the other attempts try to mirror a website, there's nothing to download -> success

According to Micah Cowan's explanation this is the expected and intended behaviour.

Note You need to log in before you can comment on or make changes to this bug.