Bug 6037 - The _remove variable suffix does not work correctly for variables used multiple times
Summary: The _remove variable suffix does not work correctly for variables used multip...
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6 M5
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-03-25 11:21 UTC by Peter Kjellerstedt
Modified: 2014-03-25 22:33 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Make _remove work correctly (741 bytes, patch)
2014-03-25 11:21 UTC, Peter Kjellerstedt
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.