]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
siggen: don't choke with traceback when data is None
authorChris Larson <chris_larson@mentor.com>
Thu, 2 Jun 2011 21:46:13 +0000 (14:46 -0700)
committerChris Larson <chris_larson@mentor.com>
Thu, 2 Jun 2011 21:46:16 +0000 (14:46 -0700)
Given we use bb.error, not bb.fatal, here, it seems this was intended to be
non-fatal, yet we'd end up trying to concatenate None. Fix this by setting an
empty task to the empty string, for the purposes of hashing. Also str() the
value we get from the datastore, just in case something other than a string
was stored there.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/bb/siggen.py

index 550280339c5b9fa468cce1889b428eca3fecc449..a9c84c474fa1a2e172cb30eb4fb44978f8d73fc8 100644 (file)
@@ -82,6 +82,10 @@ class SignatureGeneratorBasic(SignatureGenerator):
             data = d.getVar(task, False)
             lookupcache[task] = data
 
+            if data is None:
+                bb.error("Task %s from %s seems to be empty?!" % (task, fn))
+                data = ''
+
             newdeps = gendeps[task]
             seen = set()
             while newdeps:
@@ -103,9 +107,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
                     var = d.getVar(dep, False)
                     lookupcache[dep] = var
                 if var:
-                    data = data + var
-            if data is None:
-                bb.error("Task %s from %s seems to be empty?!" % (task, fn))
+                    data = data + str(var)
             self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest()
             taskdeps[task] = sorted(alldeps)