summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2021-10-12 14:21:42 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2021-10-12 14:31:12 +0200
commitb78d9de8e585f5071f62bab7362c8e69affe4102 (patch)
treebbaaba7645c6d6b0c00e9fbd0295e553428f83e0
parentc9c96799dbb030262ac03f44067ee61ada93d93d (diff)
updatesrcrev.py: work around python crash
Since commit c9c9679 ("buildconf/local.conf: don't set any machine by default") calling scripts/uprev-srcrev creates a python crash unless one makes sure a MACHINE is set. Just reading PV from the datastore before continuing with doing the uprev fixes the issue. Fixes: | Traceback (most recent call last): | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 1585, in latest_revision | return revs[key] | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/persist_data.py", line 50, in wrap_func | return f(self, *args, **kwargs) | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/persist_data.py", line 79, in wrap_func | return f(self, cursor, *args, **kwargs) | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/persist_data.py", line 167, in __getitem__ | raise KeyError(key) | KeyError: 'git:git.toradex.com.u-boot-toradex.gittoradex_2020.07' | | During handling of the above exception, another exception occurred: | | ... | | The above exception was the direct cause of the following exception: | | Traceback (most recent call last): | ... | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 1587, in latest_revision | revs[key] = rev = self._latest_revision(ud, d, name) | File "/home/krm/bla/dunfell/layers/openembedded-core/bitbake/lib/bb/fetch2/git.py", line 689, in _latest_revision | sha1, ref = l.split() | bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception ValueError: not enough values to unpack (expected 2, got 0) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--lib/recipetool/updatesrcrev.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/recipetool/updatesrcrev.py b/lib/recipetool/updatesrcrev.py
index 411e428..0c6fb19 100644
--- a/lib/recipetool/updatesrcrev.py
+++ b/lib/recipetool/updatesrcrev.py
@@ -37,6 +37,12 @@ def updatesrcrev(args):
if not rd:
return 1
+ # The line `PV = "2020.07+git${SRCPV}"` in the U-Boot 2020.07 recipe
+ # makes the uprev of that recipe fail if no MACHINE is defined.
+ # (Because then UBOOT_MACHINE or UBOOT_CONFIG is not defined.)
+ # Just reading PV of the datastore fixes the issue
+ pv = rd.getVar('PV')
+
src_uris = rd.getVar('SRC_URI').split()
revision = {}
for src_uri in src_uris: