Bug 645

Summary: wrong output of "bitbake -e"
Product: [Build System, Metadata & Runtime] BitBake Reporter: Lianhao Lu <lianhao.lu>
Component: bitbakeAssignee: Lianhao Lu <lianhao.lu>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: Medium CC: jessica.zhang, kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 1.0   
Target Milestone: 1.0 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---

Description Lianhao Lu 2011-01-06 21:22:22 UTC
The current output of "bitbake -e" contains something not meeting the bash shell syntax requirement(see the excerpt below). This cause an parse error in the eclipse plugin of bitbake commander, which prevents the project wizard and recipe file editor to work properly. We need to modify the emit_var() function in bitbake/lib/bb/data.py to fix the followings:

1. add "#" to the beginning of each line in the comment paragraph.
2. add "\" to the end of each line if <val> contains multiple lines in A="<val>". 


Excerpt from "bitbake -e"
--------------------------------
# base_dep=def base_dep_prepend(d):
	#
	# Ideally this will check a flag so we will operate properly in
	# the case where host == build == target, for now we don't work in
	# that case though.
	#

	deps = ""
	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
	# we need that built is the responsibility of the patch function / class, not
	# the application.
	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
		if (bb.data.getVar('HOST_SYS', d, 1) !=
	     	    bb.data.getVar('BUILD_SYS', d, 1)):
			deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
	return deps

base_dep="def base_dep_prepend(d):
	#
	# Ideally this will check a flag so we will operate properly in
	# the case where host == build == target, for now we don't work in
	# that case though.
	#

	deps = \"\"
	# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
	# we need that built is the responsibility of the patch function / class, not
	# the application.
	if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
		if (bb.data.getVar('HOST_SYS', d, 1) !=
	     	    bb.data.getVar('BUILD_SYS', d, 1)):
			deps += \" virtual/arm-poky-linux-gnueabi-gcc virtual/arm-poky-linux-gnueabi-compilerlibs virtual/libc \"
	return deps"
Comment 1 Lianhao Lu 2011-01-09 19:54:00 UTC
Fixed in commit 6f454c10bcdd5245ea9297f5334fc56ac06dbdb9.

1. Added "#" to the beginning of each line if the comment contains
multiple lines.

2. Added "\" to the end of each line if the shell variable value
contains multiple lines.
Comment 2 Lianhao Lu 2011-01-11 18:39:56 UTC
verified in commit.

Now the output of bitbake -e can be parsed correctly by bitbake commander's simple shell parser.