In sanity_conf_update(), in file meta/classes/sanity.bbclass, a call is made to sanity_conf_find_line(version_var_name, lines) with the intent to find a line like 'CONF_VERSION = "1"' and update the version number. However, the search is not anchored to the beginning of a line, so the search will find the var name in a comment and replace the comment with the new string. E.g., in the poky bblayers.conf file, the first three lines look like: # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly POKY_BBLAYERS_CONF_VERSION = "1" If sanity_conf_update() is called to change the version to "2", the result will be: POKY_BBLAYERS_CONF_VERSION = "2" # changes incompatibly POKY_BBLAYERS_CONF_VERSION = "1" which is certainly not the expected result. A simple fix is to anchor the search to the beginning of a line: --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -20,7 +20,7 @@ def sanity_conf_find_line(pattern, lines): if re.search(pattern, line)), (None, None)) def sanity_conf_update(fn, lines, version_var_name, new_version): - index, line = sanity_conf_find_line(version_var_name, lines) + index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines) lines[index] = '%s = "%d"\n' % (version_var_name, new_version) with open(fn, "w") as f: f.write(''.join(lines))
Submitted patch as outlined in the bug description to the oe-core mailing list. Also included some other minor cleanups in the same patch.
Merged to master and verified. http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/classes/sanity.bbclass?id=421289cbcc422d8a45018f69660a1ed3b1018cb3