From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Dongxiao Xu <dongxiao.xu@intel.com>
Cc: poky@yoctoproject.org
Subject: Re: [PATCH 2/3] bitbake: Introduce stamp-extra-info into build stamp file
Date: Sun, 09 Jan 2011 22:41:13 +0000 [thread overview]
Message-ID: <1294612873.17519.33969.camel@rex> (raw)
In-Reply-To: <7798495f49f90ea669f2f396aacf3c5844f0dbed.1294501386.git.dongxiao.xu@intel.com>
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@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)
next prev parent reply other threads:[~2011-01-09 22:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 15:52 [PATCH 0/3][RFC v2] Machine specific sysroot implementation Dongxiao Xu
2011-01-08 15:52 ` [PATCH 1/3] staging: Use relative path in sysroot-destdir for target recipes Dongxiao Xu
2011-01-08 15:53 ` [PATCH 2/3] bitbake: Introduce stamp-extra-info into build stamp file Dongxiao Xu
2011-01-09 22:41 ` Richard Purdie [this message]
2011-01-10 3:07 ` Xu, Dongxiao
2011-01-10 8:44 ` Xu, Dongxiao
2011-01-08 15:53 ` [PATCH 3/3] bitbake: machine specific sysroots implementation Dongxiao Xu
-- strict thread matches above, loose matches on Subject: below --
2011-01-11 6:18 [PATCH 0/3][RFC] Machine specific sysroot implementation Dongxiao Xu
2011-01-11 6:18 ` [PATCH 2/3] bitbake: Introduce stamp-extra-info into build stamp file Dongxiao Xu
2011-01-11 12:11 ` Joshua Lock
2011-01-12 11:48 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294612873.17519.33969.camel@rex \
--to=richard.purdie@linuxfoundation.org \
--cc=dongxiao.xu@intel.com \
--cc=poky@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.