[poky] [PATCH 2/3] bitbake: Introduce stamp-extra-info into build stamp file
Richard Purdie
richard.purdie at linuxfoundation.org
Sun Jan 9 14:41:13 PST 2011
On Sat, 2011-01-08 at 23:53 +0800, Dongxiao Xu wrote:
> For certain tasks, we need additional information in build stamp file
> except the task name and file name. stamp-extra-info is introduced as
> an flag adding to the end of stamp file name.
>
> We also implement a blacklist, in which extra stamp information will
> not be added.
To be honest I much preferred the original version of this patch. The
problem with this approach is that the data dictionary you're storing in
the siggen code is just the global config data dict. This means that if
any recipe customises BB_STAMP_EXTRA or the stamp-extra-into flag, those
changes will not be seen by this code. This is why your original of
extracting the flag at parse time and caching it was better.
I appreciate the code in those areas has changed but the original patch
should translate relatively easily.
Also note that re.compile is expensive so you'd do that at init time,
not for each stampfile.
Cheers,
Richard
> Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
> ---
> bitbake/lib/bb/siggen.py | 14 +++++++++++++-
> 1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
> index 4dc09b3..6c5a227 100644
> --- a/bitbake/lib/bb/siggen.py
> +++ b/bitbake/lib/bb/siggen.py
> @@ -43,7 +43,17 @@ class SignatureGenerator(object):
> return
>
> def stampfile(self, stampbase, file_name, taskname):
> - return "%s.%s" % (stampbase, taskname)
> + stamp_extra_info = (self.data.getVarFlag(taskname, 'stamp-extra-info', True) or self.data.getVar('BB_STAMP_EXTRA', True) or "")
> +
> + if self.stampblacklist:
> + self.sbl = re.compile(self.stampblacklist)
> + else:
> + self.sbl = None
> +
> + if self.sbl and self.sbl.search(file_name):
> + return "%s.%s" % (stampbase, taskname)
> +
> + return ("%s.%s.%s" % (stampbase, taskname, stamp_extra_info)).rstrip('.')
>
> class SignatureGeneratorBasic(SignatureGenerator):
> """
> @@ -59,6 +69,8 @@ class SignatureGeneratorBasic(SignatureGenerator):
> self.lookupcache = {}
> self.basewhitelist = (data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()
> self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None
> + self.stampblacklist = data.getVar("BB_STAMPTASK_BLACKLIST", True) or None
> + self.data = data
>
> if self.taskwhitelist:
> self.twl = re.compile(self.taskwhitelist)
More information about the poky
mailing list