* [PATCH 0/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values
@ 2015-03-11 3:21 ` Chen Qi
0 siblings, 0 replies; 6+ messages in thread
From: Chen Qi @ 2015-03-10 6:36 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 8ce2f2c3549248b2aa1259ceb28ed03be166ac6f:
maintainers.inc: Became maintainer of python2 and python3 (2015-03-09 16:01:08 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/bitbake-diffsigs-duplicates
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/bitbake-diffsigs-duplicates
Chen Qi (1):
bitbake-diffsigs: consider the situation where sigdata and siginfo
files having the same hash values
bitbake/bin/bitbake-diffsigs | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 0/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values @ 2015-03-11 3:21 ` Chen Qi 0 siblings, 0 replies; 6+ messages in thread From: Chen Qi @ 2015-03-11 3:21 UTC (permalink / raw) To: bitbake-devel The following changes since commit 8ce2f2c3549248b2aa1259ceb28ed03be166ac6f: maintainers.inc: Became maintainer of python2 and python3 (2015-03-09 16:01:08 +0000) are available in the git repository at: git://git.pokylinux.org/poky-contrib ChenQi/bitbake-diffsigs-duplicates http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/bitbake-diffsigs-duplicates Chen Qi (1): bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values bitbake/bin/bitbake-diffsigs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values 2015-03-11 3:21 ` Chen Qi @ 2015-03-11 3:21 ` Chen Qi -1 siblings, 0 replies; 6+ messages in thread From: Chen Qi @ 2015-03-10 6:36 UTC (permalink / raw) To: openembedded-core 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] -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values @ 2015-03-11 3:21 ` Chen Qi 0 siblings, 0 replies; 6+ messages in thread From: Chen Qi @ 2015-03-11 3:21 UTC (permalink / raw) To: bitbake-devel 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] -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values 2015-03-11 3:21 ` Chen Qi (?) @ 2015-04-14 9:25 ` ChenQi 2015-04-15 19:44 ` Christopher Larson -1 siblings, 1 reply; 6+ messages in thread From: ChenQi @ 2015-04-14 9:25 UTC (permalink / raw) To: bitbake-devel 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] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values 2015-04-14 9:25 ` ChenQi @ 2015-04-15 19:44 ` Christopher Larson 0 siblings, 0 replies; 6+ messages in thread From: Christopher Larson @ 2015-04-15 19:44 UTC (permalink / raw) To: ChenQi; +Cc: bitbake-devel@lists.openembedded.org [-- Attachment #1: Type: text/plain, Size: 455 bytes --] On Tue, Apr 14, 2015 at 2:25 AM, ChenQi <Qi.Chen@windriver.com> wrote: > ping > > Any comment on this one? > > Best Regards, > Chen Qi > Seems like this would be an important fix to have, from my perspective.. Honestly I didn't even know about the -t argument until I saw this :) -- Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics [-- Attachment #2: Type: text/html, Size: 861 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-04-15 19:45 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2015-04-15 19:44 ` Christopher Larson
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.