Prebuilts should not gate normal builds if the server responds with an error.

Recently the tegra2 prebuilts were uploaded with an internal only address and caused external builds to fail.

If a user cannot get the Packages file their build should continue as normal as if the server responded without a packages file in general.

BUG=chromium-os:9917
TEST=Set PORTAGE_BINHOST to invalid value and run build.

Change-Id: I95cab67da7a539afe8c48c831788eca29cc5dc69

Review URL: http://codereview.chromium.org/6085001
This commit is contained in:
David James 2011-01-04 15:36:47 -08:00
parent 8ce81f32dc
commit 3f898563fb

View File

@ -748,15 +748,13 @@ class DepGraphGenerator(object):
try:
return urllib2.urlopen(url)
except urllib2.HTTPError as e:
print "Cannot GET %s: %s" % (url, str(e))
if i + 1 >= tries or e.code < 500:
raise
else:
print "Cannot GET %s: %s" % (url, str(e))
except urllib2.URLError as e:
print "Cannot GET %s: %s" % (url, str(e))
if i + 1 >= tries:
raise
else:
print "Cannot GET %s: %s" % (url, str(e))
print "Sleeping for 10 seconds before retrying..."
time.sleep(10)
@ -1835,7 +1833,11 @@ def main():
remote_pkgs = {}
if "--getbinpkg" in emerge.opts:
binhost = emerge.settings["PORTAGE_BINHOST"]
remote_pkgs = deps.RemotePackageDatabase(binhost)
try:
remote_pkgs = deps.RemotePackageDatabase(binhost)
except (urllib2.HTTPError, urllib2.URLError):
print "Cannot resolve binhost. Building from source..."
del emerge.opts["--getbinpkg"]
deps_tree, deps_info = deps.GenDependencyTree(remote_pkgs)