* [PATCH] fetch2: Sort file checksums by value, not path
@ 2012-12-19 23:26 Tyler Hall
2013-01-18 12:45 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Tyler Hall @ 2012-12-19 23:26 UTC (permalink / raw)
To: bitbake-devel
Changing the path to a file could change the task hash even if the file
still has the same checksum. This occurs when the task depends on
multiple files and the sort order of their paths changes. Usually the
sorting is consistent because layers tend to have the same relative
paths, but this should take care of other configuations.
The problem arose when using a .bbappend to add files to a recipe in
another layer. If the layer is located alongside the other layers and
their parent directory is moved, the hash does not change. However,
moving the .bbappend layer outside of the common directory can change
the path sort order and the task hash.
Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
---
lib/bb/fetch2/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 150dc3c..4746356 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -30,6 +30,7 @@ from __future__ import print_function
import os, re
import logging
import urllib
+import operator
import bb.persist_data, bb.utils
import bb.checksum
from bb import data
@@ -729,7 +730,7 @@ def get_file_checksums(filelist, pn):
if checksum:
checksums.append((pth, checksum))
- checksums.sort()
+ checksums.sort(key=operator.itemgetter(1))
return checksums
--
1.8.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] fetch2: Sort file checksums by value, not path
2012-12-19 23:26 [PATCH] fetch2: Sort file checksums by value, not path Tyler Hall
@ 2013-01-18 12:45 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2013-01-18 12:45 UTC (permalink / raw)
To: Tyler Hall; +Cc: bitbake-devel
On Wed, 2012-12-19 at 18:26 -0500, Tyler Hall wrote:
> Changing the path to a file could change the task hash even if the file
> still has the same checksum. This occurs when the task depends on
> multiple files and the sort order of their paths changes. Usually the
> sorting is consistent because layers tend to have the same relative
> paths, but this should take care of other configuations.
>
> The problem arose when using a .bbappend to add files to a recipe in
> another layer. If the layer is located alongside the other layers and
> their parent directory is moved, the hash does not change. However,
> moving the .bbappend layer outside of the common directory can change
> the path sort order and the task hash.
>
> Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
> ---
> lib/bb/fetch2/__init__.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Good catch, merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-18 13:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 23:26 [PATCH] fetch2: Sort file checksums by value, not path Tyler Hall
2013-01-18 12:45 ` Richard Purdie
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.