summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/taskdata.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/taskdata.py')
-rw-r--r--bitbake/lib/bb/taskdata.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 181bb5e35b..17d6d95530 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -6,19 +6,23 @@ BitBake 'TaskData' implementation
6 6
7Task data collection and handling 7Task data collection and handling
8 8
9Copyright (C) 2006 Richard Purdie
10
11This program is free software; you can redistribute it and/or modify it under
12the terms of the GNU General Public License version 2 as published by the Free
13Software Foundation
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License along with
20""" 9"""
21 10
11# Copyright (C) 2006 Richard Purdie
12#
13# This program is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License version 2 as
15# published by the Free Software Foundation.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License along
23# with this program; if not, write to the Free Software Foundation, Inc.,
24# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
22from bb import data, fetch, event, mkdirhier, utils 26from bb import data, fetch, event, mkdirhier, utils
23import bb, os 27import bb, os
24 28
@@ -86,10 +90,11 @@ class TaskData:
86 90
87 return self.fn_index.index(name) 91 return self.fn_index.index(name)
88 92
89 def gettask_id(self, fn, task): 93 def gettask_id(self, fn, task, create = True):
90 """ 94 """
91 Return an ID number for the task matching fn and task. 95 Return an ID number for the task matching fn and task.
92 If it doesn't exist, create one. 96 If it doesn't exist, create one by default.
97 Optionally return None instead.
93 """ 98 """
94 fnid = self.getfn_id(fn) 99 fnid = self.getfn_id(fn)
95 100
@@ -97,6 +102,9 @@ class TaskData:
97 if task in self.tasks_lookup[fnid]: 102 if task in self.tasks_lookup[fnid]:
98 return self.tasks_lookup[fnid][task] 103 return self.tasks_lookup[fnid][task]
99 104
105 if not create:
106 return None
107
100 self.tasks_name.append(task) 108 self.tasks_name.append(task)
101 self.tasks_fnid.append(fnid) 109 self.tasks_fnid.append(fnid)
102 self.tasks_tdepends.append([]) 110 self.tasks_tdepends.append([])
@@ -529,6 +537,7 @@ class TaskData:
529 bb.msg.debug(1, bb.msg.domain.TaskData, "Resolved " + str(added) + " extra dependecies") 537 bb.msg.debug(1, bb.msg.domain.TaskData, "Resolved " + str(added) + " extra dependecies")
530 if added == 0: 538 if added == 0:
531 break 539 break
540 # self.dump_data()
532 541
533 def dump_data(self): 542 def dump_data(self):
534 """ 543 """