binman: Show filename in missing blob help message
Show the filename next to the node path in missing blob help messages, also show a generic missing blob message when there was no help message for the help tag. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:

committed by
Simon Glass

parent
c2600155af
commit
8f452bc557
@@ -112,8 +112,8 @@ def _ReadMissingBlobHelp():
|
|||||||
_FinishTag(tag, msg, result)
|
_FinishTag(tag, msg, result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _ShowBlobHelp(level, path, text):
|
def _ShowBlobHelp(level, path, text, fname):
|
||||||
tout.do_output(level, '%s:' % path)
|
tout.do_output(level, '%s (%s):' % (path, fname))
|
||||||
for line in text.splitlines():
|
for line in text.splitlines():
|
||||||
tout.do_output(level, ' %s' % line)
|
tout.do_output(level, ' %s' % line)
|
||||||
tout.do_output(level, '')
|
tout.do_output(level, '')
|
||||||
@@ -133,10 +133,17 @@ def _ShowHelpForMissingBlobs(level, missing_list):
|
|||||||
tags = entry.GetHelpTags()
|
tags = entry.GetHelpTags()
|
||||||
|
|
||||||
# Show the first match help message
|
# Show the first match help message
|
||||||
|
shown_help = False
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
if tag in missing_blob_help:
|
if tag in missing_blob_help:
|
||||||
_ShowBlobHelp(level, entry._node.path, missing_blob_help[tag])
|
_ShowBlobHelp(level, entry._node.path, missing_blob_help[tag],
|
||||||
|
entry.GetDefaultFilename())
|
||||||
|
shown_help = True
|
||||||
break
|
break
|
||||||
|
# Or a generic help message
|
||||||
|
if not shown_help:
|
||||||
|
_ShowBlobHelp(level, entry._node.path, "Missing blob",
|
||||||
|
entry.GetDefaultFilename())
|
||||||
|
|
||||||
def GetEntryModules(include_testing=True):
|
def GetEntryModules(include_testing=True):
|
||||||
"""Get a set of entry class implementations
|
"""Get a set of entry class implementations
|
||||||
|
@@ -3806,6 +3806,7 @@ class TestFunctional(unittest.TestCase):
|
|||||||
allow_missing=True)
|
allow_missing=True)
|
||||||
self.assertEqual(103, ret)
|
self.assertEqual(103, ret)
|
||||||
err = stderr.getvalue()
|
err = stderr.getvalue()
|
||||||
|
self.assertIn('(missing-file)', err)
|
||||||
self.assertRegex(err, "Image 'image'.*missing.*: blob-ext")
|
self.assertRegex(err, "Image 'image'.*missing.*: blob-ext")
|
||||||
self.assertIn('Some images are invalid', err)
|
self.assertIn('Some images are invalid', err)
|
||||||
|
|
||||||
@@ -3816,6 +3817,7 @@ class TestFunctional(unittest.TestCase):
|
|||||||
allow_missing=True, ignore_missing=True)
|
allow_missing=True, ignore_missing=True)
|
||||||
self.assertEqual(0, ret)
|
self.assertEqual(0, ret)
|
||||||
err = stderr.getvalue()
|
err = stderr.getvalue()
|
||||||
|
self.assertIn('(missing-file)', err)
|
||||||
self.assertRegex(err, "Image 'image'.*missing.*: blob-ext")
|
self.assertRegex(err, "Image 'image'.*missing.*: blob-ext")
|
||||||
self.assertIn('Some images are invalid', err)
|
self.assertIn('Some images are invalid', err)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user