merged lp:~blueyed/ubuntu-dev-tools/use-proxy-for-download

This commit is contained in:
Daniel Holbach 2012-03-18 20:25:06 +01:00
commit 63aedf6912
2 changed files with 9 additions and 2 deletions

7
debian/changelog vendored
View File

@ -1,11 +1,16 @@
ubuntu-dev-tools (0.140) UNRELEASED; urgency=low
[ Stefano Rivera ]
* Bump Standards-Version to 3.9.3, no changes needed.
* Update machine-readable copyright Format to 1.0.
* pbuilder-dist: Use the same chroot, whether the system-architecture was
the supplied architecture or was chosen by default (LP: #943435)
-- Stefano Rivera <stefanor@debian.org> Sat, 25 Feb 2012 16:09:53 +0200
[ Daniel Hahler ]
* ubuntutools/archive.py: use ProxyHandler in _download_file.
This makes use of the system proxy (e.g. http_proxy).
-- Daniel Hahler <ubuntu@thequod.de> Fri, 16 Mar 2012 16:21:00 +0100
ubuntu-dev-tools (0.139) unstable; urgency=low

View File

@ -317,8 +317,10 @@ class SourcePackage(object):
if parsed.scheme == 'file':
in_ = open(parsed.path, 'r')
else:
proxy = urllib2.ProxyHandler() # uses default proxy from environment
opener = urllib2.build_opener(proxy)
try:
in_ = urllib2.urlopen(url)
in_ = opener.open(url)
except urllib2.URLError:
return False