我可以在 d.getVar [Yocto] 上使用正则表达式或通配符吗
我希望获取以某个名称开头的所有变量的值。对于我当前的解决方案,我解析 d 并查找所有变量并挑选出以预期名称开头的变量。
但是,我们可以使用正则表达式或通配符吗?
像这样的东西: d.getVar("ALLOWED_RECIPES_%")
期望输出:以 ALLOWED_RECIPE 开头的所有变量的值列表
I am looking to get values of all the variables starting with some name. For my current solution, I parse the d and look for all the variables and pick out the ones starting with expected name.
But instead, can we use regex or wild char.
Something like this: d.getVar("ALLOWED_RECIPES_%")
Expect output: List of values for all variables starting with ALLOWED_RECIPE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我尝试管理的一个示例:
该示例为
.VARIABLE.
创建一个正则表达式,并检查所有d变量。
之后,它为每个变量及其值创建一个字典。
bitbake testvars -c getvars
的输出:注意:
Bitbake 不提供将多个变量组合在一起的方法,因此直接正则表达式应用程序不可能使用
d .getVar
,所以这是我现在能想到的最好的解决方案。Here is an example I tried to manage:
The example creates a regex for
.VARIABLE.
, and it checks for all matches on alld
variables.After that, it creates a dictionary for each variable and its value.
Output of
bitbake testvars -c getvars
:NOTE:
Bitbake does not offer a way to get multiple variables together and for that the direct regex application is not possible with
d.getVar
, so a that is the best solution I can think of right now.