Currently, if PKGV equals to PV, it will not be written to buildhistory. pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else '' However, in buildhistory-diff, PKGV, instead of PV, is regarded as a monitored variable. So buildhistory.bbclass always record PV instead of PKGV, but buildhistory-diff treats PKGV as a monitored variable instead of PV. This results in the following unexpected behavior. If a recipe's PV changes, for example, hello_1.0.bb is renamed to hello_2.0.bb. Then buildhistory-diff cannot report changes in PV area. And actually, the PKGV is not recorded. So I would like to suggest that in buildhistory.bbclass, we always record PKGV. The same logic applies to PKG, PKGE and PKGR. - pkgvars['PKG'] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else '' - pkgvars['PKGE'] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else '' - pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else '' - pkgvars['PKGR'] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else '' + pkgvars['PKG'] = pkginfo.pkg + pkgvars['PKGE'] = pkginfo.pkge + pkgvars['PKGV'] = pkginfo.pkgv + pkgvars['PKGR'] = pkginfo.pkgr //Chen Qi
I'm a bit confused as to what issue you're actually trying to solve here. buildhistory-diff is only supposed to report PKG, PKGE, PKGV and PKGR changing if the value has been set differently from the corresponding standard variable, so as far as I can tell it's working as designed.
Chen Qi is on vacation for a few days, so I'm going to step in and attempt to answer the question from Paul. I believe this change is requested because otherwise there is no way to detect a package upgrade/uprev when using buildhistory. This type of upgrade can happy when comparing no-GPLv3 and GPLv3 builds -- or just simple software updates when a layer gets updated. We want to use the buildhistory from one build to the next to look for changes that have occurred that may be unexpected.
Hi Paul, In bitbake.conf, we have: PKGV ?= "${PV}" So if not set specially, when PV changes, PKGV changes as well; it's just that PKGV is not recorded and buildhistory-diff only catches changes of PKGV instead of PV. Here's an example showing that when changing PV, PKGV actually changes. chenqi@pek-qchen1-d1:~/poky/build$ bitbake useradd-example -e | grep ^PKGV PKGV="1.0" chenqi@pek-qchen1-d1:~/poky/build$ mv ../meta-skeleton/recipes-skeleton/useradd/useradd-example.bb ../meta-skeleton/recipes-skeleton/useradd/useradd-example_2.0.bb chenqi@pek-qchen1-d1:~/poky/build$ bitbake useradd-example -e | grep ^PKGV PKGV="2.0" The problem I'm solving here is to make buildhistory catch PKGV changes correctly. For now, even if PKGV changes, buildhistory-diff cannot catch the change as PKGV equals to PV and is not recorded. Best Regards, Chen Qi
This has been fixed in a slightly different way in master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f995febd2ebd43774cb1cc5917f3f3c46a744519