* [PATCH] siggen.py: sort task hash depedencies with basepath
@ 2011-11-23 8:04 Matthew McClintock
2011-11-23 17:49 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Matthew McClintock @ 2011-11-23 8:04 UTC (permalink / raw)
To: bitbake-devel
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.
Signed-off-by: Matthew McClintock <msm@freescale.com>
---
lib/bb/siggen.py | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 217f29b..9b73c4c 100644
--- a/lib/bb/siggen.py
+++ b/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'])
--
1.7.6.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] siggen.py: sort task hash depedencies with basepath
2011-11-23 8:04 [PATCH] siggen.py: sort task hash depedencies with basepath Matthew McClintock
@ 2011-11-23 17:49 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2011-11-23 17:49 UTC (permalink / raw)
To: Matthew McClintock; +Cc: bitbake-devel
On Wed, 2011-11-23 at 02:04 -0600, Matthew McClintock wrote:
> 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.
>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> lib/bb/siggen.py | 25 ++++++++++++++-----------
> 1 files changed, 14 insertions(+), 11 deletions(-)
Merged to master, thanks!
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-23 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 8:04 [PATCH] siggen.py: sort task hash depedencies with basepath Matthew McClintock
2011-11-23 17:49 ` 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.