Bitbake:附加空格和替代语法

时间:2018-10-21 08:45:46

标签: bitbake

在阅读一些食谱时,我已经无数次地使用了这种奇怪的语法:

来自linux-raspberripi.inc

# Add the kernel debugger over console kernel command line option if enabled
CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'

# Disable rpi logo on boot
CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'

第二个作业与第一个作业相比有什么区别吗?

_append将需要您照顾空间,而+ =会为您完成。因此,由于已经在字符串中添加了空格,所以不会=完全一样吗?

openembedded - Syntax of recipes中的一个有趣的发现是他们提到(反?)样式:

CFLAGS_prepend = "-I${S}/myincludes "
CFLAGS_prepend += "-I${S}/myincludes2 "
Note also the lack of a space when using += to append to a prepend value - remember that the += operator is adding space itself.

1 个答案:

答案 0 :(得分:0)

CMDLINE =“ a” CMDLINE_append =“ b”

给出CMDLINE =“ a b”

CMDLINE =“ a” CMDLINE_append + =“ b”

给出CMDLINE =“ a b”

所以一个将导致双倍空格,一个将具有一个空格。