From: ChenQi <Qi.Chen@windriver.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH 1/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values
Date: Tue, 14 Apr 2015 17:25:24 +0800 [thread overview]
Message-ID: <552CDD04.8040204@windriver.com> (raw)
In-Reply-To: <0db087157f7aeabca45cf27e64b200dea9b08c41.1425969366.git.Qi.Chen@windriver.com>
ping
Any comment on this one?
Best Regards,
Chen Qi
On 03/11/2015 11:21 AM, Chen Qi wrote:
> For now, `bitbake-diffsigs -t <recipe> <task>' doesn't work. It always outputs
> nothing.
>
> The problem is that bitbake-diffsigs are comparing sigdata and siginfo files
> that have the same hash value. This is not what we want. These two files are
> actually duplicates considering the purpose of bitbake-diffsigs. So we need
> to remove one of them so that bitbake-diffsigs could actually compare the
> correct signature files.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> bitbake/bin/bitbake-diffsigs | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
> index 08ae00d..196f0b7 100755
> --- a/bitbake/bin/bitbake-diffsigs
> +++ b/bitbake/bin/bitbake-diffsigs
> @@ -46,6 +46,12 @@ logger = logger_create('bitbake-diffsigs')
> def find_compare_task(bbhandler, pn, taskname):
> """ Find the most recent signature files for the specified PN/task and compare them """
>
> + def get_hashval(siginfo):
> + if siginfo.endswith('.siginfo'):
> + return siginfo.rpartition(':')[2].partition('_')[0]
> + else:
> + return siginfo.rpartition('.')[2]
> +
> if not hasattr(bb.siggen, 'find_siginfo'):
> logger.error('Metadata does not support finding signature data files')
> sys.exit(1)
> @@ -54,7 +60,7 @@ def find_compare_task(bbhandler, pn, taskname):
> taskname = 'do_%s' % taskname
>
> filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
> - latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-2:]
> + latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-3:]
> if not latestfiles:
> logger.error('No sigdata files found matching %s %s' % (pn, taskname))
> sys.exit(1)
> @@ -62,6 +68,16 @@ def find_compare_task(bbhandler, pn, taskname):
> logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
> sys.exit(1)
> else:
> + # It's possible that latestfiles contain 3 elements and the first two have the same hash value.
> + # In this case, we delete the second element.
> + # The above case is actually the most common one. Because we may have sigdata file and siginfo
> + # file having the same hash value. Comparing such two files makes no sense.
> + if len(latestfiles) == 3:
> + hash0 = get_hashval(latestfiles[0])
> + hash1 = get_hashval(latestfiles[1])
> + if hash0 == hash1:
> + latestfiles.pop(1)
> +
> # Define recursion callback
> def recursecb(key, hash1, hash2):
> hashes = [hash1, hash2]
next prev parent reply other threads:[~2015-04-14 9:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 6:36 [PATCH 0/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values Chen Qi
2015-03-11 3:21 ` Chen Qi
2015-03-10 6:36 ` [PATCH 1/1] " Chen Qi
2015-03-11 3:21 ` Chen Qi
2015-04-14 9:25 ` ChenQi [this message]
2015-04-15 19:44 ` Christopher Larson
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=552CDD04.8040204@windriver.com \
--to=qi.chen@windriver.com \
--cc=bitbake-devel@lists.openembedded.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.