--- a/tools/userland-fetch Mon May 09 19:47:00 2016 -0700
+++ b/tools/userland-fetch Tue May 10 11:58:11 2016 -0700
@@ -226,7 +226,8 @@
jsurl = "http://%s/pypi/%s/json" % (host, name)
try:
- f = urlopen(jsurl)
+ # Don't wait very long for the connection
+ f = urlopen(jsurl, None, 2)
except HTTPError as e:
if e.getcode() == 404:
print "Unknown component '%s'" % name
@@ -281,11 +282,7 @@
# command line url is a fallback, so it's last
if url != None and url not in urls:
- scheme, path = splittype(url)
- if scheme == "pypi":
- url = pypi_url(url, filename)
- if url != None and url not in urls:
- urls.append(url)
+ urls.append(url)
return urls
@@ -328,6 +325,22 @@
if not quiet:
print "failed"
continue
+ elif scheme == "pypi":
+ nurl = pypi_url(url, file_arg)
+ if nurl:
+ if not quiet:
+ print "\n translated %s to %s..." % (
+ url, nurl),
+ print "\n downloading...",
+ else:
+ if not quiet:
+ print "\n unable to contact PyPI",
+ continue
+ name = download(nurl, timeout_arg, file_arg, quiet)
+ if name is None:
+ if not quiet:
+ print "failed"
+ continue
yield name