]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars
authorRandy Witt <randy.e.witt@linux.intel.com>
Thu, 7 Apr 2016 06:55:39 +0000 (23:55 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 9 Apr 2016 06:58:09 +0000 (07:58 +0100)
commit14f05cbdc2ad8d59a94af1c8816567d93c39c88c
tree6e6309def14b2476088f078e0814dedc44c98de9
parent292bffc8412cd0ddc0c6d16e872c7801e1a67890
lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars

edit_metadata() would corrupt a variable that was multiline, but
had the ending quotes on the same line as the last value. For example:

    TEST_VAR = " foo \
    bar"

would become " foo ba" because the code would always delete the last
character on the line and then do it again if the line ended in the
quote. This however doesn't show up if you have:

    TEST_VAR = " foo \
    bar \
    "

which is how all the test cases were written.

This patch fixes that bug and adds and fixes a test that matched the bugs
behavior rather than the expected behavior.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/tests/utils.py
lib/bb/utils.py