Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 244997 - app-portage/mirrorselect thinks wget doesn't handle ipv6 (patch)
Summary: app-portage/mirrorselect thinks wget doesn't handle ipv6 (patch)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low trivial (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-30 19:04 UTC by Steven Robertson
Modified: 2009-01-01 01:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
app-portage/mirrorselect: patch to enable wget ipv6 and remove deprecated warnings (mirrorselect.patch,4.33 KB, patch)
2008-12-04 20:28 UTC, Steven Robertson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Robertson 2008-10-30 19:04:58 UTC
from /usr/sbin/mirrorselect lines 598-601:

        if _have_bin('wget'):
                fetch = 'wget'
                ipv6 = False

but wget supports ipv6 downloads just fine, as long as it's compiled with the 'ipv6' use flag.  Rather than digging into the package db to find out, there's a simple check: wget --help omits the ipv4/ipv6-only options if it's compiled without ipv6 support.  A grep for that will give you an accurate check of whether wget supports ipv6.

I'm happy to write a patch, although it's worth noting that popen2 is deprecated now, so a larger patch to switch to using the subprocess module isn't an unwarranted suggestion.  (I'd be fine writing and testing that as well.)

Thanks.
Comment 1 michael@smith-li.com 2008-11-30 05:55:56 UTC
> I'm happy to write a patch, although it's worth noting that popen2 is
> deprecated now, so a larger patch to switch to using the subprocess module
> isn't an unwarranted suggestion.  (I'd be fine writing and testing that as
> well.)

I'm not officially a Gentoo dev, but I think it's safe to say that patches are appreciated.
Comment 2 Steven Robertson 2008-12-04 20:28:47 UTC
Created attachment 174261 [details, diff]
app-portage/mirrorselect: patch to enable wget ipv6 and remove deprecated warnings
Comment 3 Steven Robertson 2008-12-04 20:29:55 UTC
Changes:

* Popen statements in netselect(), deeptime(), interactive(), and _have_bin()
  use subprocess.Popen instead of os.popen or popen2.Popen[34].

* getlist() uses urllib2() instead of a popen'd wget.

* function _wget_supports_ipv6() added and used.

Code should be compatible with python >= 2.4, and now gives no warnings with python-2.6 -3, so it should be okay to use with the 2to3 tool.

HTH.
Comment 4 Zac Medico gentoo-dev 2008-12-05 21:55:13 UTC
Instead of spawning a fetcher like wget or curl, I think it's best to convert the code to download the file with urllib. We can use an alarm signal to implement the timeout behavior.
Comment 5 Zac Medico gentoo-dev 2009-01-01 01:18:30 UTC
Thanks, this is fixed in mirrorselect-1.4 (includes urllib and popen2 to subprocess conversion).