-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Josh Williams wrote:
> Consider this example, which happens to be how I realised this problem:
> 
> wget http://www.mxpx.com/ -r --base=.
> 
> Here, I want the entire site to be downloaded with each link pointing
> to the local file. This works for some links, but it does not take
> references to the root directory into account, such as this:
> 
> <a href="/index.php">Home</a>
> 
> Here, wget just ignores the --base parameter and leaves the link as
> "/index.php".
> 
> I realise that this may seem like a sticky situation, but consider
> this solution: Let's say that I have a photo album on my personal
> homepage with the following directory scheme:
> 
> /
> /photos/
> /photos/hawaii
> /photos/concerts
> 
> In /photos/concerts/index.html, I have a link to "/index.html". When
> wget parses the html, it could then become: "../../index.html". All we
> need to know is how many directories deep we are.
> 
> Would this be an acceptable solution? If so, I'd be glad to write a patch.

As I mentioned to Josh in IRC, the desired behavior is accomplished with
the -k option.

The --base option isn't meant to have any effect on the downloaded files
or anything; it's intended to be the equivalent to the HTML <base/>
element's href attribute; and I'd be very, very reluctant to change it
away from that meaning.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGmTtG7M8hyUobTrERCO+OAJ4gLRhhHF/2QlaWkg9ILaq/K2aOgACZAdd6
kolQgo8dljpJrX5M+NWRo28=
=A156
-----END PGP SIGNATURE-----

Reply via email to