gitsm: catch SRCPV expansion errors
PATCH 1/1 gitsm: catch SRCPV expansion errors
SRCPV may fail to expand, for instance like this:
Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used.
Signed-off-by Alexander Kanavin <[email protected]>
--- bitbake/lib/bb/fetch2/gitsm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/gitsm.py +4 -1
@@ -140,7 +140,10 @@ class GitSM(Git): # Workaround for issues with SRCPV/SRCREV_FORMAT errors # error refer to 'multiple' repositories. Only the repository # in the original SRC_URI actually matters... - ld.setVar('SRCPV', d.getVar('SRCPV')) + try: + ld.setVar('SRCPV', d.getVar('SRCPV')) + except Exception as e: + raise bb.fetch2.UnpackError(e, url) ld.setVar('SRCREV_FORMAT', module) function(ud, url, module, paths[module], ld)
Signature · 1 line
2.17.1