1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake/fetch2: reduce output for fetch failures

Make the warning for the initial fetch failure a single line - we don't
need the full command and output here yet, but write it into the log in
full as a debug message. However, if fetching from mirrors fails as well
then print out the full details for the first error that occurred as an
ERROR rather than a WARNING.

Since this is logged as an ERROR, combined with an earlier patch it
suppresses the full log which does make the output much more readable
for any fetch error.

Fixes [YOCTO #1832].

(Bitbake rev: 6bbdc7d259c0cc041b62dbdb26cfc3ec6edcb6f3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton
2012-01-13 17:01:50 +00:00
committed by Richard Purdie
parent eb6291b36f
commit 5f5ae14ee3
+6 -1
View File
@@ -965,6 +965,7 @@ class Fetch(object):
if premirroronly: if premirroronly:
self.d.setVar("BB_NO_NETWORK", "1") self.d.setVar("BB_NO_NETWORK", "1")
firsterr = None
if not localpath and m.need_update(u, ud, self.d): if not localpath and m.need_update(u, ud, self.d):
try: try:
logger.debug(1, "Trying Upstream") logger.debug(1, "Trying Upstream")
@@ -980,7 +981,9 @@ class Fetch(object):
raise raise
except BBFetchException as e: except BBFetchException as e:
logger.warn(str(e)) logger.warn('Failed to fetch URL %s' % u)
logger.debug(1, str(e))
firsterr = e
# Remove any incomplete fetch # Remove any incomplete fetch
if os.path.isfile(ud.localpath): if os.path.isfile(ud.localpath):
bb.utils.remove(ud.localpath) bb.utils.remove(ud.localpath)
@@ -989,6 +992,8 @@ class Fetch(object):
localpath = try_mirrors (self.d, ud, mirrors) localpath = try_mirrors (self.d, ud, mirrors)
if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1): if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
if firsterr:
logger.error(str(firsterr))
raise FetchError("Unable to fetch URL from any source.", u) raise FetchError("Unable to fetch URL from any source.", u)
update_stamp(u, ud, self.d) update_stamp(u, ud, self.d)