From 2485a81f48c141ccd612121f15918673fe276f15 Mon Sep 17 00:00:00 2001 From: Matthew McClintock Date: Wed, 23 Nov 2011 02:04:00 -0600 Subject: siggen.py: sort task hash depedencies with basepath Without this patch the tash hash dependencies can be in a order that is dependent upon directory/filesystem layout. With this change the data is sorted the same regardless. Without this the dependent hashes could be in different orders on different systems and consequently final md5 hash would differ as well even though nothing else changed. (Bitbake rev: 9a2029899c946ce9aa8adbc85f2cfe7a85b92182) Signed-off-by: Matthew McClintock Signed-off-by: Richard Purdie --- bitbake/lib/bb/siggen.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'bitbake/lib/bb/siggen.py') diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 3eed66425e..9231291b43 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py @@ -136,7 +136,7 @@ class SignatureGeneratorBasic(SignatureGenerator): k = fn + "." + task data = dataCache.basetaskhash[k] self.runtaskdeps[k] = [] - for dep in sorted(deps): + for dep in sorted(deps, key=clean_basepath): # We only manipulate the dependencies for packages not in the whitelist if self.twl and not self.twl.search(dataCache.pkg_fn[fn]): # then process the actual dependencies @@ -218,6 +218,19 @@ def dump_this_task(outfile, d): task = "do_" + d.getVar("BB_CURRENTTASK", True) bb.parse.siggen.dump_sigtask(fn, task, outfile, "customfile") +def clean_basepath(a): + if a.startswith("virtual:"): + b = a.rsplit(":", 1)[0] + a.rsplit("/", 1)[1] + else: + b = a.rsplit("/", 1)[1] + return b + +def clean_basepaths(a): + b = {} + for x in a: + b[clean_basepath(x)] = a[x] + return b + def compare_sigfiles(a, b): p1 = pickle.Unpickler(file(a, "rb")) a_data = p1.load() @@ -236,16 +249,6 @@ def compare_sigfiles(a, b): removed = sb - sa return changed, added, removed - def clean_basepaths(a): - b = {} - for x in a: - if x.startswith("virtual:"): - y = x.rsplit(":", 1)[0] + x.rsplit("/", 1)[1] - else: - y = x.rsplit("/", 1)[1] - b[y] = a[x] - return b - if 'basewhitelist' in a_data and a_data['basewhitelist'] != b_data['basewhitelist']: print "basewhitelist changed from %s to %s" % (a_data['basewhitelist'], b_data['basewhitelist']) print "changed items: %s" % a_data['basewhitelist'].symmetric_difference(b_data['basewhitelist']) -- cgit v1.2.3-54-g00ecf