Bug 6037

Summary: The _remove variable suffix does not work correctly for variables used multiple times
Product: [Build System, Metadata & Runtime] BitBake Reporter: Peter Kjellerstedt <peter.kjellerstedt>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: olof.johansson, poky.bs.watcher, poky.watcher
Version: 1.6   
Target Milestone: 1.6 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
Make _remove work correctly none

Description Peter Kjellerstedt 2014-03-25 11:21:54 UTC
Created attachment 1852 [details]
Make _remove work correctly

If the _remove variable suffix is used on a variable that is then used multiple times within a recipe, the _remove will only apply to the first use of the variable. E.g., add the following to any recipe: 

FOO = "foo bar"
FOO_remove = "bar"
FOO_FOO = "${FOO} ${FOO}"

do_foo_foo[nostamp] = "1"
do_foo_foo() {
        bbnote "FOO_FOO: ${FOO_FOO}"
}
addtask foo_foo

and look at the output from the foo_foo task. It will say:

NOTE: FOO_FOO: foo foo bar

rather than the expected:

NOTE: FOO_FOO: foo foo

I have attached a patch that I got from Richard Purdie when I fist discovered the problem. It does solve the problem, but I think he was not happy with the solution.
Comment 1 Richard Purdie 2014-03-25 22:33:02 UTC
Fxied in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=39846ddbce87d26eb68870914bf86a8ce5e86e5c

I also added a test case for bitbake-selftest.