diff options
author | Tyler Hall <tylerwhall@gmail.com> | 2012-12-19 18:26:50 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-18 12:49:51 +0000 |
commit | 22bd19d208f0251f5a1f9b98f3cac66181f3fc07 (patch) | |
tree | defd4827c5b4627701f81cc213de59dea80c8781 /lib | |
parent | 0c99df2af1d35dbc9f51cd68b4908029cef288fa (diff) | |
download | bitbake-22bd19d208f0251f5a1f9b98f3cac66181f3fc07.tar.gz |
fetch2: Sort file checksums by value, not path
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch2/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 150dc3c18..47463561e 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 |