diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2021-10-12 14:21:42 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-10-18 18:23:16 +0200 |
commit | 49af4af336c6600f8a97837ce7fd2581c5c027f7 (patch) | |
tree | efe412b96137f088491f40fd8f83d6696816daf7 /lib | |
parent | 99b3efdefdd2440bf14a759e276f1d37a0c78680 (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>
(cherry picked from commit b78d9de8e585f5071f62bab7362c8e69affe4102)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/recipetool/updatesrcrev.py | 6 |
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: |