]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
knotty: avoid errors when fetching outside of a task
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 15 Jul 2016 08:54:30 +0000 (20:54 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Jul 2016 07:51:45 +0000 (08:51 +0100)
In a few places we use the fetcher code to fetch files outside of a
task, for example uninative in OE. In that case the pid of the event is
0 and that was causing an error in BBUIHelper.eventHandler(). Check the
pid and do nothing if it's 0.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/uihelper.py

index 1915e4770362525d595b200d04dbdb435da71c82..f64fa18ec279cdca1ace35c2c242de01ee49b097 100644 (file)
@@ -54,9 +54,10 @@ class BBUIHelper:
             self.tasknumber_total = event.stats.total
             self.needUpdate = True
         if isinstance(event, bb.build.TaskProgress):
-            self.running_tasks[event.pid]['progress'] = event.progress
-            self.running_tasks[event.pid]['rate'] = event.rate
-            self.needUpdate = True
+            if event.pid > 0:
+                self.running_tasks[event.pid]['progress'] = event.progress
+                self.running_tasks[event.pid]['rate'] = event.rate
+                self.needUpdate = True
 
     def getTasks(self):
         self.needUpdate = False