Bitbake:数据存储是什么数据结构?

Bitbake: What data structure is datastore?

以下是 Bitbake 用户手册中的一句话: "BitBake parses each recipe and append file located with BBFILES and stores the values of various variables into the datastore."

'datastore' 是什么数据类型?是列表还是元组还是字典?或者它是什么数据类型?

您可以通过在同一环境中执行 type(foo) 来计算出 python 中对象的类型。至于该特定类型(数据存储),快速 google 表示它既不是元组也不是字典,而是一个自定义对象,API 记录在 here.

Bitbake 的数据存储是键+值对的复杂存储,其中键也有标志(也是键+值对)。它是用写入后端的副本编写的自定义结构。它支持 'overrides' 的想法,其中一个具有特殊命名的变量可以覆盖另一个。请参阅 https://git.openembedded.org/bitbake/tree/lib/bb/data_smart.py and https://git.openembedded.org/bitbake/tree/lib/bb/data.py within the codebase for the implementation, the Bitbake manual for information about how to use the data store and https://git.openembedded.org/bitbake/tree/lib/bb/tests/data.py 了解它的单元测试。