diff options
author | Richard Purdie <richard@openedhand.com> | 2007-01-08 23:53:01 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-01-08 23:53:01 +0000 |
commit | f5665d5bfcfb13d01da9e4c7d5046453e80f7baf (patch) | |
tree | b8908549afaf3006bf3763419711090ac999c2a4 /bitbake/lib | |
parent | aec95de5f7dca2afa3a4a0bdb0d4d553c13f680d (diff) | |
download | poky-f5665d5bfcfb13d01da9e4c7d5046453e80f7baf.tar.gz |
bitbake: Sync with upstream.
* File licence headers were sanitised causing most of the diff.
* cooker.py was created from bin/bitbake.
* cvs fetcher port option was added
* The -f force option was fixed to work correctly
* Multiple entries in rrecrdeps are now handled correctly
(allows adding do_deploy to image depends)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib')
29 files changed, 1281 insertions, 571 deletions
diff --git a/bitbake/lib/bb/COW.py b/bitbake/lib/bb/COW.py index 826d435f98..e5063d60a8 100644 --- a/bitbake/lib/bb/COW.py +++ b/bitbake/lib/bb/COW.py | |||
@@ -1,12 +1,27 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
3 | """ | 3 | # |
4 | This is a copy on write dictionary and set which abuses classes to try and be nice and fast. | 4 | # This is a copy on write dictionary and set which abuses classes to try and be nice and fast. |
5 | 5 | # | |
6 | Please Note: | 6 | # Copyright (C) 2006 Tim Amsell |
7 | Be careful when using mutable types (ie Dict and Lists) - operations involving these are SLOW. | 7 | # |
8 | Assign a file to __warn__ to get warnings about slow operations. | 8 | # This program is free software; you can redistribute it and/or modify |
9 | """ | 9 | # it under the terms of the GNU General Public License version 2 as |
10 | # published by the Free Software Foundation. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License along | ||
18 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
20 | # | ||
21 | #Please Note: | ||
22 | # Be careful when using mutable types (ie Dict and Lists) - operations involving these are SLOW. | ||
23 | # Assign a file to __warn__ to get warnings about slow operations. | ||
24 | # | ||
10 | 25 | ||
11 | from inspect import getmro | 26 | from inspect import getmro |
12 | 27 | ||
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index 61eb5f3db8..a11af84b12 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -1,27 +1,25 @@ | |||
1 | #!/usr/bin/python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | # |
5 | BitBake Build System Python Library | 4 | # BitBake Build System Python Library |
6 | 5 | # | |
7 | Copyright (C) 2003 Holger Schurig | 6 | # Copyright (C) 2003 Holger Schurig |
8 | Copyright (C) 2003, 2004 Chris Larson | 7 | # Copyright (C) 2003, 2004 Chris Larson |
9 | 8 | # | |
10 | Based on Gentoo's portage.py. | 9 | # Based on Gentoo's portage.py. |
11 | 10 | # | |
12 | This program is free software; you can redistribute it and/or modify it under | 11 | # This program is free software; you can redistribute it and/or modify |
13 | the terms of the GNU General Public License as published by the Free Software | 12 | # it under the terms of the GNU General Public License version 2 as |
14 | Foundation; either version 2 of the License, or (at your option) any later | 13 | # published by the Free Software Foundation. |
15 | version. | 14 | # |
16 | 15 | # This program is distributed in the hope that it will be useful, | |
17 | This program is distributed in the hope that it will be useful, but WITHOUT | 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 18 | # GNU General Public License for more details. |
20 | 19 | # | |
21 | You should have received a copy of the GNU General Public License along with | 20 | # You should have received a copy of the GNU General Public License along |
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 21 | # with this program; if not, write to the Free Software Foundation, Inc., |
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | 22 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
24 | """ | ||
25 | 23 | ||
26 | __version__ = "1.7.4" | 24 | __version__ = "1.7.4" |
27 | 25 | ||
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 942bdc1a39..bf6b612f32 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -1,29 +1,29 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | # |
5 | BitBake 'Build' implementation | 4 | # BitBake 'Build' implementation |
6 | 5 | # | |
7 | Core code for function execution and task handling in the | 6 | # Core code for function execution and task handling in the |
8 | BitBake build tools. | 7 | # BitBake build tools. |
9 | 8 | # | |
10 | Copyright (C) 2003, 2004 Chris Larson | 9 | # Copyright (C) 2003, 2004 Chris Larson |
11 | 10 | # | |
12 | Based on Gentoo's portage.py. | 11 | # Based on Gentoo's portage.py. |
13 | 12 | # | |
14 | This program is free software; you can redistribute it and/or modify it under | 13 | # This program is free software; you can redistribute it and/or modify |
15 | the terms of the GNU General Public License as published by the Free Software | 14 | # it under the terms of the GNU General Public License version 2 as |
16 | Foundation; either version 2 of the License, or (at your option) any later | 15 | # published by the Free Software Foundation. |
17 | version. | 16 | # |
18 | 17 | # This program is distributed in the hope that it will be useful, | |
19 | This program is distributed in the hope that it will be useful, but WITHOUT | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 20 | # GNU General Public License for more details. |
22 | 21 | # | |
23 | You should have received a copy of the GNU General Public License along with | 22 | # You should have received a copy of the GNU General Public License along |
24 | 23 | # with this program; if not, write to the Free Software Foundation, Inc., | |
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | 24 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
26 | """ | 25 | # |
26 | #Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | 27 | ||
28 | from bb import data, fetch, event, mkdirhier, utils | 28 | from bb import data, fetch, event, mkdirhier, utils |
29 | import bb, os | 29 | import bb, os |
@@ -219,14 +219,18 @@ def exec_func_shell(func, d): | |||
219 | bb.msg.error(bb.msg.domain.Build, "function %s failed" % func) | 219 | bb.msg.error(bb.msg.domain.Build, "function %s failed" % func) |
220 | if data.getVar("BBINCLUDELOGS", d): | 220 | if data.getVar("BBINCLUDELOGS", d): |
221 | bb.msg.error(bb.msg.domain.Build, "log data follows (%s)" % logfile) | 221 | bb.msg.error(bb.msg.domain.Build, "log data follows (%s)" % logfile) |
222 | f = open(logfile, "r") | 222 | number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d) |
223 | while True: | 223 | if number_of_lines: |
224 | l = f.readline() | 224 | os.system('tail -n%s %s' % (number_of_lines, logfile)) |
225 | if l == '': | 225 | else: |
226 | break | 226 | f = open(logfile, "r") |
227 | l = l.rstrip() | 227 | while True: |
228 | print '| %s' % l | 228 | l = f.readline() |
229 | f.close() | 229 | if l == '': |
230 | break | ||
231 | l = l.rstrip() | ||
232 | print '| %s' % l | ||
233 | f.close() | ||
230 | else: | 234 | else: |
231 | bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile) | 235 | bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile) |
232 | raise FuncFailed( logfile ) | 236 | raise FuncFailed( logfile ) |
@@ -252,9 +256,8 @@ def exec_task(task, d): | |||
252 | raise EventException("Missing node in task graph", InvalidTask(task, d)) | 256 | raise EventException("Missing node in task graph", InvalidTask(task, d)) |
253 | 257 | ||
254 | # check whether this task needs executing.. | 258 | # check whether this task needs executing.. |
255 | if not data.getVarFlag(task, 'force', d): | 259 | if stamp_is_current(task, d): |
256 | if stamp_is_current(task, d): | 260 | return 1 |
257 | return 1 | ||
258 | 261 | ||
259 | # follow digraph path up, then execute our way back down | 262 | # follow digraph path up, then execute our way back down |
260 | def execute(graph, item): | 263 | def execute(graph, item): |
@@ -291,59 +294,43 @@ def exec_task(task, d): | |||
291 | 294 | ||
292 | # make stamp, or cause event and raise exception | 295 | # make stamp, or cause event and raise exception |
293 | if not data.getVarFlag(task, 'nostamp', d): | 296 | if not data.getVarFlag(task, 'nostamp', d): |
294 | mkstamp(task, d) | 297 | make_stamp(task, d) |
295 | 298 | ||
296 | def stamp_is_current_cache(dataCache, file_name, task, checkdeps = 1): | 299 | def extract_stamp_data(d, fn): |
297 | """ | 300 | """ |
298 | Check status of a given task's stamp. | 301 | Extracts stamp data from d which is either a data dictonary (fn unset) |
299 | Returns 0 if it is not current and needs updating. | 302 | or a dataCache entry (fn set). |
300 | Same as stamp_is_current but works against the dataCache instead of d | ||
301 | """ | 303 | """ |
302 | task_graph = dataCache.task_queues[file_name] | 304 | if fn: |
303 | 305 | return (d.task_queues[fn], d.stamp[fn], d.task_deps[fn]) | |
304 | if not dataCache.stamp[file_name]: | 306 | task_graph = data.getVar('_task_graph', d) |
305 | return 0 | 307 | if not task_graph: |
306 | 308 | task_graph = bb.digraph() | |
307 | stampfile = "%s.%s" % (dataCache.stamp[file_name], task) | 309 | data.setVar('_task_graph', task_graph, d) |
308 | if not os.access(stampfile, os.F_OK): | 310 | return (task_graph, data.getVar('STAMP', d, 1), None) |
309 | return 0 | ||
310 | |||
311 | if checkdeps == 0: | ||
312 | return 1 | ||
313 | |||
314 | import stat | ||
315 | tasktime = os.stat(stampfile)[stat.ST_MTIME] | ||
316 | |||
317 | _deps = [] | ||
318 | def checkStamp(graph, task): | ||
319 | # check for existance | ||
320 | if 'nostamp' in dataCache.task_deps[file_name] and task in dataCache.task_deps[file_name]['nostamp']: | ||
321 | return 1 | ||
322 | |||
323 | if not stamp_is_current_cache(dataCache, file_name, task, 0): | ||
324 | return 0 | ||
325 | |||
326 | depfile = "%s.%s" % (dataCache.stamp[file_name], task) | ||
327 | deptime = os.stat(depfile)[stat.ST_MTIME] | ||
328 | if deptime > tasktime: | ||
329 | return 0 | ||
330 | return 1 | ||
331 | 311 | ||
332 | return task_graph.walkdown(task, checkStamp) | 312 | def extract_stamp(d, fn): |
313 | """ | ||
314 | Extracts stamp format which is either a data dictonary (fn unset) | ||
315 | or a dataCache entry (fn set). | ||
316 | """ | ||
317 | if fn: | ||
318 | return d.stamp[fn] | ||
319 | return data.getVar('STAMP', d, 1) | ||
333 | 320 | ||
334 | def stamp_is_current(task, d, checkdeps = 1): | 321 | def stamp_is_current(task, d, file_name = None, checkdeps = 1): |
335 | """ | 322 | """ |
336 | Check status of a given task's stamp. | 323 | Check status of a given task's stamp. |
337 | Returns 0 if it is not current and needs updating. | 324 | Returns 0 if it is not current and needs updating. |
325 | (d can be a data dict or dataCache) | ||
338 | """ | 326 | """ |
339 | task_graph = data.getVar('_task_graph', d) | 327 | |
340 | if not task_graph: | 328 | (task_graph, stampfn, taskdep) = extract_stamp_data(d, file_name) |
341 | task_graph = bb.digraph() | 329 | |
342 | data.setVar('_task_graph', task_graph, d) | 330 | if not stampfn: |
343 | stamp = data.getVar('STAMP', d) | ||
344 | if not stamp: | ||
345 | return 0 | 331 | return 0 |
346 | stampfile = "%s.%s" % (data.expand(stamp, d), task) | 332 | |
333 | stampfile = "%s.%s" % (stampfn, task) | ||
347 | if not os.access(stampfile, os.F_OK): | 334 | if not os.access(stampfile, os.F_OK): |
348 | return 0 | 335 | return 0 |
349 | 336 | ||
@@ -356,13 +343,17 @@ def stamp_is_current(task, d, checkdeps = 1): | |||
356 | _deps = [] | 343 | _deps = [] |
357 | def checkStamp(graph, task): | 344 | def checkStamp(graph, task): |
358 | # check for existance | 345 | # check for existance |
359 | if data.getVarFlag(task, 'nostamp', d): | 346 | if file_name: |
360 | return 1 | 347 | if 'nostamp' in taskdep and task in taskdep['nostamp']: |
348 | return 1 | ||
349 | else: | ||
350 | if data.getVarFlag(task, 'nostamp', d): | ||
351 | return 1 | ||
361 | 352 | ||
362 | if not stamp_is_current(task, d, 0): | 353 | if not stamp_is_current(task, d, file_name, 0 ): |
363 | return 0 | 354 | return 0 |
364 | 355 | ||
365 | depfile = "%s.%s" % (data.expand(stamp, d), task) | 356 | depfile = "%s.%s" % (stampfn, task) |
366 | deptime = os.stat(depfile)[stat.ST_MTIME] | 357 | deptime = os.stat(depfile)[stat.ST_MTIME] |
367 | if deptime > tasktime: | 358 | if deptime > tasktime: |
368 | return 0 | 359 | return 0 |
@@ -370,24 +361,40 @@ def stamp_is_current(task, d, checkdeps = 1): | |||
370 | 361 | ||
371 | return task_graph.walkdown(task, checkStamp) | 362 | return task_graph.walkdown(task, checkStamp) |
372 | 363 | ||
373 | 364 | def stamp_internal(task, d, file_name): | |
374 | def md5_is_current(task): | 365 | """ |
375 | """Check if a md5 file for a given task is current""" | 366 | Internal stamp helper function |
376 | 367 | Removes any stamp for the given task | |
377 | 368 | Makes sure the stamp directory exists | |
378 | def mkstamp(task, d): | 369 | Returns the stamp path+filename |
379 | """Creates/updates a stamp for a given task""" | 370 | """ |
380 | stamp = data.getVar('STAMP', d) | 371 | stamp = extract_stamp(d, file_name) |
381 | if not stamp: | 372 | if not stamp: |
382 | return | 373 | return |
383 | stamp = "%s.%s" % (data.expand(stamp, d), task) | 374 | stamp = "%s.%s" % (stamp, task) |
384 | mkdirhier(os.path.dirname(stamp)) | 375 | mkdirhier(os.path.dirname(stamp)) |
385 | # Remove the file and recreate to force timestamp | 376 | # Remove the file and recreate to force timestamp |
386 | # change on broken NFS filesystems | 377 | # change on broken NFS filesystems |
387 | if os.access(stamp, os.F_OK): | 378 | if os.access(stamp, os.F_OK): |
388 | os.remove(stamp) | 379 | os.remove(stamp) |
389 | f = open(stamp, "w") | 380 | return stamp |
390 | f.close() | 381 | |
382 | def make_stamp(task, d, file_name = None): | ||
383 | """ | ||
384 | Creates/updates a stamp for a given task | ||
385 | (d can be a data dict or dataCache) | ||
386 | """ | ||
387 | stamp = stamp_internal(task, d, file_name) | ||
388 | if stamp: | ||
389 | f = open(stamp, "w") | ||
390 | f.close() | ||
391 | |||
392 | def del_stamp(task, d, file_name = None): | ||
393 | """ | ||
394 | Removes a stamp for a given task | ||
395 | (d can be a data dict or dataCache) | ||
396 | """ | ||
397 | stamp_internal(task, d, file_name) | ||
391 | 398 | ||
392 | def add_task(task, deps, d): | 399 | def add_task(task, deps, d): |
393 | task_graph = data.getVar('_task_graph', d) | 400 | task_graph = data.getVar('_task_graph', d) |
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 05c42518a7..934d230e6a 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -1,10 +1,9 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | # |
5 | BitBake 'Event' implementation | 4 | # BitBake 'Event' implementation |
6 | 5 | # | |
7 | Caching of bitbake variables before task execution | 6 | # Caching of bitbake variables before task execution |
8 | 7 | ||
9 | # Copyright (C) 2006 Richard Purdie | 8 | # Copyright (C) 2006 Richard Purdie |
10 | 9 | ||
@@ -14,21 +13,20 @@ Caching of bitbake variables before task execution | |||
14 | # Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer | 13 | # Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer |
15 | # Copyright (C) 2005 Holger Hans Peter Freyther | 14 | # Copyright (C) 2005 Holger Hans Peter Freyther |
16 | # Copyright (C) 2005 ROAD GmbH | 15 | # Copyright (C) 2005 ROAD GmbH |
16 | # | ||
17 | # This program is free software; you can redistribute it and/or modify | ||
18 | # it under the terms of the GNU General Public License version 2 as | ||
19 | # published by the Free Software Foundation. | ||
20 | # | ||
21 | # This program is distributed in the hope that it will be useful, | ||
22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | # GNU General Public License for more details. | ||
25 | # | ||
26 | # You should have received a copy of the GNU General Public License along | ||
27 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
28 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | 29 | ||
18 | This program is free software; you can redistribute it and/or modify it under | ||
19 | the terms of the GNU General Public License as published by the Free Software | ||
20 | Foundation; either version 2 of the License, or (at your option) any later | ||
21 | version. | ||
22 | |||
23 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
24 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
25 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
26 | |||
27 | You should have received a copy of the GNU General Public License along with | ||
28 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
29 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
30 | |||
31 | """ | ||
32 | 30 | ||
33 | import os, re | 31 | import os, re |
34 | import bb.data | 32 | import bb.data |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py new file mode 100644 index 0000000000..8a9c588633 --- /dev/null +++ b/bitbake/lib/bb/cooker.py | |||
@@ -0,0 +1,665 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | ||
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
4 | # | ||
5 | # Copyright (C) 2003, 2004 Chris Larson | ||
6 | # Copyright (C) 2003, 2004 Phil Blundell | ||
7 | # Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer | ||
8 | # Copyright (C) 2005 Holger Hans Peter Freyther | ||
9 | # Copyright (C) 2005 ROAD GmbH | ||
10 | # Copyright (C) 2006 Richard Purdie | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | |||
25 | import sys, os, getopt, glob, copy, os.path, re, time | ||
26 | import bb | ||
27 | from bb import utils, data, parse, event, cache, providers, taskdata, runqueue | ||
28 | from sets import Set | ||
29 | import itertools | ||
30 | |||
31 | parsespin = itertools.cycle( r'|/-\\' ) | ||
32 | |||
33 | #============================================================================# | ||
34 | # BBStatistics | ||
35 | #============================================================================# | ||
36 | class BBStatistics: | ||
37 | """ | ||
38 | Manage build statistics for one run | ||
39 | """ | ||
40 | def __init__(self ): | ||
41 | self.attempt = 0 | ||
42 | self.success = 0 | ||
43 | self.fail = 0 | ||
44 | self.deps = 0 | ||
45 | |||
46 | def show( self ): | ||
47 | print "Build statistics:" | ||
48 | print " Attempted builds: %d" % self.attempt | ||
49 | if self.fail: | ||
50 | print " Failed builds: %d" % self.fail | ||
51 | if self.deps: | ||
52 | print " Dependencies not satisfied: %d" % self.deps | ||
53 | if self.fail or self.deps: return 1 | ||
54 | else: return 0 | ||
55 | |||
56 | #============================================================================# | ||
57 | # BBCooker | ||
58 | #============================================================================# | ||
59 | class BBCooker: | ||
60 | """ | ||
61 | Manages one bitbake build run | ||
62 | """ | ||
63 | |||
64 | Statistics = BBStatistics # make it visible from the shell | ||
65 | |||
66 | def __init__( self ): | ||
67 | self.build_cache_fail = [] | ||
68 | self.build_cache = [] | ||
69 | self.stats = BBStatistics() | ||
70 | self.status = None | ||
71 | |||
72 | self.cache = None | ||
73 | self.bb_cache = None | ||
74 | |||
75 | def tryBuildPackage(self, fn, item, task, the_data, build_depends): | ||
76 | """ | ||
77 | Build one task of a package, optionally build following task depends | ||
78 | """ | ||
79 | bb.event.fire(bb.event.PkgStarted(item, the_data)) | ||
80 | try: | ||
81 | self.stats.attempt += 1 | ||
82 | if not build_depends: | ||
83 | bb.data.setVarFlag('do_%s' % task, 'dontrundeps', 1, the_data) | ||
84 | if not self.configuration.dry_run: | ||
85 | bb.build.exec_task('do_%s' % task, the_data) | ||
86 | bb.event.fire(bb.event.PkgSucceeded(item, the_data)) | ||
87 | self.build_cache.append(fn) | ||
88 | return True | ||
89 | except bb.build.FuncFailed: | ||
90 | self.stats.fail += 1 | ||
91 | bb.msg.error(bb.msg.domain.Build, "task stack execution failed") | ||
92 | bb.event.fire(bb.event.PkgFailed(item, the_data)) | ||
93 | self.build_cache_fail.append(fn) | ||
94 | raise | ||
95 | except bb.build.EventException, e: | ||
96 | self.stats.fail += 1 | ||
97 | event = e.args[1] | ||
98 | bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % bb.event.getName(event)) | ||
99 | bb.event.fire(bb.event.PkgFailed(item, the_data)) | ||
100 | self.build_cache_fail.append(fn) | ||
101 | raise | ||
102 | |||
103 | def tryBuild( self, fn, build_depends): | ||
104 | """ | ||
105 | Build a provider and its dependencies. | ||
106 | build_depends is a list of previous build dependencies (not runtime) | ||
107 | If build_depends is empty, we're dealing with a runtime depends | ||
108 | """ | ||
109 | |||
110 | the_data = self.bb_cache.loadDataFull(fn, self.configuration.data) | ||
111 | |||
112 | item = self.status.pkg_fn[fn] | ||
113 | |||
114 | if bb.build.stamp_is_current('do_%s' % self.configuration.cmd, the_data): | ||
115 | self.build_cache.append(fn) | ||
116 | return True | ||
117 | |||
118 | return self.tryBuildPackage(fn, item, self.configuration.cmd, the_data, build_depends) | ||
119 | |||
120 | def showVersions( self ): | ||
121 | pkg_pn = self.status.pkg_pn | ||
122 | preferred_versions = {} | ||
123 | latest_versions = {} | ||
124 | |||
125 | # Sort by priority | ||
126 | for pn in pkg_pn.keys(): | ||
127 | (last_ver,last_file,pref_ver,pref_file) = bb.providers.findBestProvider(pn, self.configuration.data, self.status) | ||
128 | preferred_versions[pn] = (pref_ver, pref_file) | ||
129 | latest_versions[pn] = (last_ver, last_file) | ||
130 | |||
131 | pkg_list = pkg_pn.keys() | ||
132 | pkg_list.sort() | ||
133 | |||
134 | for p in pkg_list: | ||
135 | pref = preferred_versions[p] | ||
136 | latest = latest_versions[p] | ||
137 | |||
138 | if pref != latest: | ||
139 | prefstr = pref[0][0] + "-" + pref[0][1] | ||
140 | else: | ||
141 | prefstr = "" | ||
142 | |||
143 | print "%-30s %20s %20s" % (p, latest[0][0] + "-" + latest[0][1], | ||
144 | prefstr) | ||
145 | |||
146 | |||
147 | def showEnvironment( self ): | ||
148 | """Show the outer or per-package environment""" | ||
149 | if self.configuration.buildfile: | ||
150 | self.cb = None | ||
151 | self.bb_cache = bb.cache.init(self) | ||
152 | try: | ||
153 | self.configuration.data = self.bb_cache.loadDataFull(self.configuration.buildfile, self.configuration.data) | ||
154 | except IOError, e: | ||
155 | bb.msg.fatal(bb.msg.domain.Parsing, "Unable to read %s: %s" % ( self.configuration.buildfile, e )) | ||
156 | except Exception, e: | ||
157 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) | ||
158 | # emit variables and shell functions | ||
159 | try: | ||
160 | data.update_data( self.configuration.data ) | ||
161 | data.emit_env(sys.__stdout__, self.configuration.data, True) | ||
162 | except Exception, e: | ||
163 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) | ||
164 | # emit the metadata which isnt valid shell | ||
165 | data.expandKeys( self.configuration.data ) | ||
166 | for e in self.configuration.data.keys(): | ||
167 | if data.getVarFlag( e, 'python', self.configuration.data ): | ||
168 | sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, data.getVar(e, self.configuration.data, 1))) | ||
169 | |||
170 | def generateDotGraph( self, pkgs_to_build, ignore_deps ): | ||
171 | """ | ||
172 | Generate a task dependency graph. | ||
173 | |||
174 | pkgs_to_build A list of packages that needs to be built | ||
175 | ignore_deps A list of names where processing of dependencies | ||
176 | should be stopped. e.g. dependencies that get | ||
177 | """ | ||
178 | |||
179 | for dep in ignore_deps: | ||
180 | self.status.ignored_dependencies.add(dep) | ||
181 | |||
182 | localdata = data.createCopy(self.configuration.data) | ||
183 | bb.data.update_data(localdata) | ||
184 | bb.data.expandKeys(localdata) | ||
185 | taskdata = bb.taskdata.TaskData(self.configuration.abort) | ||
186 | |||
187 | runlist = [] | ||
188 | try: | ||
189 | for k in pkgs_to_build: | ||
190 | taskdata.add_provider(localdata, self.status, k) | ||
191 | runlist.append([k, "do_%s" % self.configuration.cmd]) | ||
192 | taskdata.add_unresolved(localdata, self.status) | ||
193 | except bb.providers.NoProvider: | ||
194 | sys.exit(1) | ||
195 | rq = bb.runqueue.RunQueue() | ||
196 | rq.prepare_runqueue(self, self.configuration.data, self.status, taskdata, runlist) | ||
197 | |||
198 | seen_fnids = [] | ||
199 | depends_file = file('depends.dot', 'w' ) | ||
200 | tdepends_file = file('task-depends.dot', 'w' ) | ||
201 | print >> depends_file, "digraph depends {" | ||
202 | print >> tdepends_file, "digraph depends {" | ||
203 | rq.prio_map.reverse() | ||
204 | for task1 in range(len(rq.runq_fnid)): | ||
205 | task = rq.prio_map[task1] | ||
206 | taskname = rq.runq_task[task] | ||
207 | fnid = rq.runq_fnid[task] | ||
208 | fn = taskdata.fn_index[fnid] | ||
209 | pn = self.status.pkg_fn[fn] | ||
210 | version = self.bb_cache.getVar('PV', fn, True ) + '-' + self.bb_cache.getVar('PR', fn, True) | ||
211 | print >> tdepends_file, '"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn) | ||
212 | for dep in rq.runq_depends[task]: | ||
213 | depfn = taskdata.fn_index[rq.runq_fnid[dep]] | ||
214 | deppn = self.status.pkg_fn[depfn] | ||
215 | print >> tdepends_file, '"%s.%s" -> "%s.%s"' % (pn, rq.runq_task[task], deppn, rq.runq_task[dep]) | ||
216 | if fnid not in seen_fnids: | ||
217 | seen_fnids.append(fnid) | ||
218 | packages = [] | ||
219 | print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn) | ||
220 | for depend in self.status.deps[fn]: | ||
221 | print >> depends_file, '"%s" -> "%s"' % (pn, depend) | ||
222 | rdepends = self.status.rundeps[fn] | ||
223 | for package in rdepends: | ||
224 | for rdepend in rdepends[package]: | ||
225 | print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend) | ||
226 | packages.append(package) | ||
227 | rrecs = self.status.runrecs[fn] | ||
228 | for package in rrecs: | ||
229 | for rdepend in rrecs[package]: | ||
230 | print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend) | ||
231 | if not package in packages: | ||
232 | packages.append(package) | ||
233 | for package in packages: | ||
234 | if package != pn: | ||
235 | print >> depends_file, '"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn) | ||
236 | for depend in self.status.deps[fn]: | ||
237 | print >> depends_file, '"%s" -> "%s"' % (package, depend) | ||
238 | # Prints a flattened form of the above where subpackages of a package are merged into the main pn | ||
239 | #print >> depends_file, '"%s" [label="%s %s\\n%s\\n%s"]' % (pn, pn, taskname, version, fn) | ||
240 | #for rdep in taskdata.rdepids[fnid]: | ||
241 | # print >> depends_file, '"%s" -> "%s" [style=dashed]' % (pn, taskdata.run_names_index[rdep]) | ||
242 | #for dep in taskdata.depids[fnid]: | ||
243 | # print >> depends_file, '"%s" -> "%s"' % (pn, taskdata.build_names_index[dep]) | ||
244 | print >> depends_file, "}" | ||
245 | print >> tdepends_file, "}" | ||
246 | bb.msg.note(1, bb.msg.domain.Collection, "Dependencies saved to 'depends.dot'") | ||
247 | bb.msg.note(1, bb.msg.domain.Collection, "Task dependencies saved to 'task-depends.dot'") | ||
248 | |||
249 | def buildDepgraph( self ): | ||
250 | all_depends = self.status.all_depends | ||
251 | pn_provides = self.status.pn_provides | ||
252 | |||
253 | localdata = data.createCopy(self.configuration.data) | ||
254 | bb.data.update_data(localdata) | ||
255 | bb.data.expandKeys(localdata) | ||
256 | |||
257 | def calc_bbfile_priority(filename): | ||
258 | for (regex, pri) in self.status.bbfile_config_priorities: | ||
259 | if regex.match(filename): | ||
260 | return pri | ||
261 | return 0 | ||
262 | |||
263 | # Handle PREFERRED_PROVIDERS | ||
264 | for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split(): | ||
265 | (providee, provider) = p.split(':') | ||
266 | if providee in self.status.preferred and self.status.preferred[providee] != provider: | ||
267 | bb.msg.error(bb.msg.domain.Provider, "conflicting preferences for %s: both %s and %s specified" % (providee, provider, self.status.preferred[providee])) | ||
268 | self.status.preferred[providee] = provider | ||
269 | |||
270 | # Calculate priorities for each file | ||
271 | for p in self.status.pkg_fn.keys(): | ||
272 | self.status.bbfile_priority[p] = calc_bbfile_priority(p) | ||
273 | |||
274 | def buildWorldTargetList(self): | ||
275 | """ | ||
276 | Build package list for "bitbake world" | ||
277 | """ | ||
278 | all_depends = self.status.all_depends | ||
279 | pn_provides = self.status.pn_provides | ||
280 | bb.msg.debug(1, bb.msg.domain.Parsing, "collating packages for \"world\"") | ||
281 | for f in self.status.possible_world: | ||
282 | terminal = True | ||
283 | pn = self.status.pkg_fn[f] | ||
284 | |||
285 | for p in pn_provides[pn]: | ||
286 | if p.startswith('virtual/'): | ||
287 | bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to %s provider starting with virtual/" % (f, p)) | ||
288 | terminal = False | ||
289 | break | ||
290 | for pf in self.status.providers[p]: | ||
291 | if self.status.pkg_fn[pf] != pn: | ||
292 | bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to both us and %s providing %s" % (f, pf, p)) | ||
293 | terminal = False | ||
294 | break | ||
295 | if terminal: | ||
296 | self.status.world_target.add(pn) | ||
297 | |||
298 | # drop reference count now | ||
299 | self.status.possible_world = None | ||
300 | self.status.all_depends = None | ||
301 | |||
302 | def myProgressCallback( self, x, y, f, from_cache ): | ||
303 | """Update any tty with the progress change""" | ||
304 | if os.isatty(sys.stdout.fileno()): | ||
305 | sys.stdout.write("\rNOTE: Handling BitBake files: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) ) | ||
306 | sys.stdout.flush() | ||
307 | else: | ||
308 | if x == 1: | ||
309 | sys.stdout.write("Parsing .bb files, please wait...") | ||
310 | sys.stdout.flush() | ||
311 | if x == y: | ||
312 | sys.stdout.write("done.") | ||
313 | sys.stdout.flush() | ||
314 | |||
315 | def interactiveMode( self ): | ||
316 | """Drop off into a shell""" | ||
317 | try: | ||
318 | from bb import shell | ||
319 | except ImportError, details: | ||
320 | bb.msg.fatal(bb.msg.domain.Parsing, "Sorry, shell not available (%s)" % details ) | ||
321 | else: | ||
322 | bb.data.update_data( self.configuration.data ) | ||
323 | bb.data.expandKeys( self.configuration.data ) | ||
324 | shell.start( self ) | ||
325 | sys.exit( 0 ) | ||
326 | |||
327 | def parseConfigurationFile( self, afile ): | ||
328 | try: | ||
329 | self.configuration.data = bb.parse.handle( afile, self.configuration.data ) | ||
330 | |||
331 | # Add the handlers we inherited by INHERIT | ||
332 | # we need to do this manually as it is not guranteed | ||
333 | # we will pick up these classes... as we only INHERIT | ||
334 | # on .inc and .bb files but not on .conf | ||
335 | data = bb.data.createCopy( self.configuration.data ) | ||
336 | inherits = ["base"] + (bb.data.getVar('INHERIT', data, True ) or "").split() | ||
337 | for inherit in inherits: | ||
338 | data = bb.parse.handle( os.path.join('classes', '%s.bbclass' % inherit ), data, True ) | ||
339 | |||
340 | # FIXME: This assumes that we included at least one .inc file | ||
341 | for var in bb.data.keys(data): | ||
342 | if bb.data.getVarFlag(var, 'handler', data): | ||
343 | bb.event.register(var,bb.data.getVar(var, data)) | ||
344 | |||
345 | except IOError: | ||
346 | bb.msg.fatal(bb.msg.domain.Parsing, "Unable to open %s" % afile ) | ||
347 | except bb.parse.ParseError, details: | ||
348 | bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (afile, details) ) | ||
349 | |||
350 | def handleCollections( self, collections ): | ||
351 | """Handle collections""" | ||
352 | if collections: | ||
353 | collection_list = collections.split() | ||
354 | for c in collection_list: | ||
355 | regex = bb.data.getVar("BBFILE_PATTERN_%s" % c, self.configuration.data, 1) | ||
356 | if regex == None: | ||
357 | bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s not defined" % c) | ||
358 | continue | ||
359 | priority = bb.data.getVar("BBFILE_PRIORITY_%s" % c, self.configuration.data, 1) | ||
360 | if priority == None: | ||
361 | bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PRIORITY_%s not defined" % c) | ||
362 | continue | ||
363 | try: | ||
364 | cre = re.compile(regex) | ||
365 | except re.error: | ||
366 | bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s \"%s\" is not a valid regular expression" % (c, regex)) | ||
367 | continue | ||
368 | try: | ||
369 | pri = int(priority) | ||
370 | self.status.bbfile_config_priorities.append((cre, pri)) | ||
371 | except ValueError: | ||
372 | bb.msg.error(bb.msg.domain.Parsing, "invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority)) | ||
373 | |||
374 | |||
375 | def cook(self, configuration): | ||
376 | """ | ||
377 | We are building stuff here. We do the building | ||
378 | from here. By default we try to execute task | ||
379 | build. | ||
380 | """ | ||
381 | |||
382 | self.configuration = configuration | ||
383 | |||
384 | if self.configuration.verbose: | ||
385 | bb.msg.set_verbose(True) | ||
386 | |||
387 | if self.configuration.debug: | ||
388 | bb.msg.set_debug_level(self.configuration.debug) | ||
389 | else: | ||
390 | bb.msg.set_debug_level(0) | ||
391 | |||
392 | if self.configuration.debug_domains: | ||
393 | bb.msg.set_debug_domains(self.configuration.debug_domains) | ||
394 | |||
395 | self.configuration.data = bb.data.init() | ||
396 | |||
397 | for f in self.configuration.file: | ||
398 | self.parseConfigurationFile( f ) | ||
399 | |||
400 | self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) ) | ||
401 | |||
402 | if not self.configuration.cmd: | ||
403 | self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build" | ||
404 | |||
405 | # | ||
406 | # Special updated configuration we use for firing events | ||
407 | # | ||
408 | self.configuration.event_data = bb.data.createCopy(self.configuration.data) | ||
409 | bb.data.update_data(self.configuration.event_data) | ||
410 | |||
411 | if self.configuration.show_environment: | ||
412 | self.showEnvironment() | ||
413 | sys.exit( 0 ) | ||
414 | |||
415 | # inject custom variables | ||
416 | if not bb.data.getVar("BUILDNAME", self.configuration.data): | ||
417 | bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), self.configuration.data) | ||
418 | bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S',time.gmtime()),self.configuration.data) | ||
419 | |||
420 | buildname = bb.data.getVar("BUILDNAME", self.configuration.data) | ||
421 | |||
422 | if self.configuration.interactive: | ||
423 | self.interactiveMode() | ||
424 | |||
425 | if self.configuration.buildfile is not None: | ||
426 | bf = os.path.abspath( self.configuration.buildfile ) | ||
427 | try: | ||
428 | os.stat(bf) | ||
429 | except OSError: | ||
430 | (filelist, masked) = self.collect_bbfiles() | ||
431 | regexp = re.compile(self.configuration.buildfile) | ||
432 | matches = [] | ||
433 | for f in filelist: | ||
434 | if regexp.search(f) and os.path.isfile(f): | ||
435 | bf = f | ||
436 | matches.append(f) | ||
437 | if len(matches) != 1: | ||
438 | bb.msg.error(bb.msg.domain.Parsing, "Unable to match %s (%s matches found):" % (self.configuration.buildfile, len(matches))) | ||
439 | for f in matches: | ||
440 | bb.msg.error(bb.msg.domain.Parsing, " %s" % f) | ||
441 | sys.exit(1) | ||
442 | bf = matches[0] | ||
443 | |||
444 | bbfile_data = bb.parse.handle(bf, self.configuration.data) | ||
445 | |||
446 | # Remove stamp for target if force mode active | ||
447 | if self.configuration.force: | ||
448 | bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (self.configuration.cmd, bf)) | ||
449 | bb.build.del_stamp('do_%s' % self.configuration.cmd, bbfile_data) | ||
450 | |||
451 | item = bb.data.getVar('PN', bbfile_data, 1) | ||
452 | try: | ||
453 | self.tryBuildPackage(bf, item, self.configuration.cmd, bbfile_data, True) | ||
454 | except bb.build.EventException: | ||
455 | bb.msg.error(bb.msg.domain.Build, "Build of '%s' failed" % item ) | ||
456 | |||
457 | sys.exit( self.stats.show() ) | ||
458 | |||
459 | # initialise the parsing status now we know we will need deps | ||
460 | self.status = bb.cache.CacheData() | ||
461 | |||
462 | ignore = bb.data.getVar("ASSUME_PROVIDED", self.configuration.data, 1) or "" | ||
463 | self.status.ignored_dependencies = Set( ignore.split() ) | ||
464 | |||
465 | self.handleCollections( bb.data.getVar("BBFILE_COLLECTIONS", self.configuration.data, 1) ) | ||
466 | |||
467 | pkgs_to_build = self.configuration.pkgs_to_build | ||
468 | |||
469 | bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, 1) | ||
470 | if bbpkgs: | ||
471 | pkgs_to_build.extend(bbpkgs.split()) | ||
472 | if len(pkgs_to_build) == 0 and not self.configuration.show_versions \ | ||
473 | and not self.configuration.show_environment: | ||
474 | print "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help'" | ||
475 | print "for usage information." | ||
476 | sys.exit(0) | ||
477 | |||
478 | # Import Psyco if available and not disabled | ||
479 | if not self.configuration.disable_psyco: | ||
480 | try: | ||
481 | import psyco | ||
482 | except ImportError: | ||
483 | bb.msg.note(1, bb.msg.domain.Collection, "Psyco JIT Compiler (http://psyco.sf.net) not available. Install it to increase performance.") | ||
484 | else: | ||
485 | psyco.bind( self.parse_bbfiles ) | ||
486 | else: | ||
487 | bb.msg.note(1, bb.msg.domain.Collection, "You have disabled Psyco. This decreases performance.") | ||
488 | |||
489 | try: | ||
490 | bb.msg.debug(1, bb.msg.domain.Collection, "collecting .bb files") | ||
491 | (filelist, masked) = self.collect_bbfiles() | ||
492 | self.parse_bbfiles(filelist, masked, self.myProgressCallback) | ||
493 | bb.msg.debug(1, bb.msg.domain.Collection, "parsing complete") | ||
494 | |||
495 | if self.configuration.parse_only: | ||
496 | bb.msg.note(1, bb.msg.domain.Collection, "Requested parsing .bb files only. Exiting.") | ||
497 | return | ||
498 | |||
499 | |||
500 | self.buildDepgraph() | ||
501 | |||
502 | if self.configuration.show_versions: | ||
503 | self.showVersions() | ||
504 | sys.exit( 0 ) | ||
505 | if 'world' in pkgs_to_build: | ||
506 | self.buildWorldTargetList() | ||
507 | pkgs_to_build.remove('world') | ||
508 | for t in self.status.world_target: | ||
509 | pkgs_to_build.append(t) | ||
510 | |||
511 | if self.configuration.dot_graph: | ||
512 | self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps ) | ||
513 | sys.exit( 0 ) | ||
514 | |||
515 | bb.event.fire(bb.event.BuildStarted(buildname, pkgs_to_build, self.configuration.event_data)) | ||
516 | |||
517 | localdata = data.createCopy(self.configuration.data) | ||
518 | bb.data.update_data(localdata) | ||
519 | bb.data.expandKeys(localdata) | ||
520 | |||
521 | taskdata = bb.taskdata.TaskData(self.configuration.abort) | ||
522 | |||
523 | runlist = [] | ||
524 | try: | ||
525 | for k in pkgs_to_build: | ||
526 | taskdata.add_provider(localdata, self.status, k) | ||
527 | runlist.append([k, "do_%s" % self.configuration.cmd]) | ||
528 | taskdata.add_unresolved(localdata, self.status) | ||
529 | except bb.providers.NoProvider: | ||
530 | sys.exit(1) | ||
531 | |||
532 | rq = bb.runqueue.RunQueue() | ||
533 | rq.prepare_runqueue(self, self.configuration.data, self.status, taskdata, runlist) | ||
534 | try: | ||
535 | failures = rq.execute_runqueue(self, self.configuration.data, self.status, taskdata, runlist) | ||
536 | except runqueue.TaskFailure, fnids: | ||
537 | for fnid in fnids: | ||
538 | bb.msg.error(bb.msg.domain.Build, "'%s' failed" % taskdata.fn_index[fnid]) | ||
539 | sys.exit(1) | ||
540 | bb.event.fire(bb.event.BuildCompleted(buildname, pkgs_to_build, self.configuration.event_data, failures)) | ||
541 | |||
542 | sys.exit( self.stats.show() ) | ||
543 | |||
544 | except KeyboardInterrupt: | ||
545 | bb.msg.note(1, bb.msg.domain.Collection, "KeyboardInterrupt - Build not completed.") | ||
546 | sys.exit(1) | ||
547 | |||
548 | def get_bbfiles( self, path = os.getcwd() ): | ||
549 | """Get list of default .bb files by reading out the current directory""" | ||
550 | contents = os.listdir(path) | ||
551 | bbfiles = [] | ||
552 | for f in contents: | ||
553 | (root, ext) = os.path.splitext(f) | ||
554 | if ext == ".bb": | ||
555 | bbfiles.append(os.path.abspath(os.path.join(os.getcwd(),f))) | ||
556 | return bbfiles | ||
557 | |||
558 | def find_bbfiles( self, path ): | ||
559 | """Find all the .bb files in a directory (uses find)""" | ||
560 | findcmd = 'find ' + path + ' -name *.bb | grep -v SCCS/' | ||
561 | try: | ||
562 | finddata = os.popen(findcmd) | ||
563 | except OSError: | ||
564 | return [] | ||
565 | return finddata.readlines() | ||
566 | |||
567 | def collect_bbfiles( self ): | ||
568 | """Collect all available .bb build files""" | ||
569 | parsed, cached, skipped, masked = 0, 0, 0, 0 | ||
570 | self.bb_cache = bb.cache.init(self) | ||
571 | |||
572 | files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split() | ||
573 | data.setVar("BBFILES", " ".join(files), self.configuration.data) | ||
574 | |||
575 | if not len(files): | ||
576 | files = self.get_bbfiles() | ||
577 | |||
578 | if not len(files): | ||
579 | bb.msg.error(bb.msg.domain.Collection, "no files to build.") | ||
580 | |||
581 | newfiles = [] | ||
582 | for f in files: | ||
583 | if os.path.isdir(f): | ||
584 | dirfiles = self.find_bbfiles(f) | ||
585 | if dirfiles: | ||
586 | newfiles += dirfiles | ||
587 | continue | ||
588 | newfiles += glob.glob(f) or [ f ] | ||
589 | |||
590 | bbmask = bb.data.getVar('BBMASK', self.configuration.data, 1) | ||
591 | |||
592 | if not bbmask: | ||
593 | return (newfiles, 0) | ||
594 | |||
595 | try: | ||
596 | bbmask_compiled = re.compile(bbmask) | ||
597 | except sre_constants.error: | ||
598 | bb.msg.fatal(bb.msg.domain.Collection, "BBMASK is not a valid regular expression.") | ||
599 | |||
600 | finalfiles = [] | ||
601 | for i in xrange( len( newfiles ) ): | ||
602 | f = newfiles[i] | ||
603 | if bbmask and bbmask_compiled.search(f): | ||
604 | bb.msg.debug(1, bb.msg.domain.Collection, "skipping masked file %s" % f) | ||
605 | masked += 1 | ||
606 | continue | ||
607 | finalfiles.append(f) | ||
608 | |||
609 | return (finalfiles, masked) | ||
610 | |||
611 | def parse_bbfiles(self, filelist, masked, progressCallback = None): | ||
612 | parsed, cached, skipped = 0, 0, 0 | ||
613 | for i in xrange( len( filelist ) ): | ||
614 | f = filelist[i] | ||
615 | |||
616 | bb.msg.debug(1, bb.msg.domain.Collection, "parsing %s" % f) | ||
617 | |||
618 | # read a file's metadata | ||
619 | try: | ||
620 | fromCache, skip = self.bb_cache.loadData(f, self.configuration.data) | ||
621 | if skip: | ||
622 | skipped += 1 | ||
623 | bb.msg.debug(2, bb.msg.domain.Collection, "skipping %s" % f) | ||
624 | self.bb_cache.skip(f) | ||
625 | continue | ||
626 | elif fromCache: cached += 1 | ||
627 | else: parsed += 1 | ||
628 | deps = None | ||
629 | |||
630 | # Disabled by RP as was no longer functional | ||
631 | # allow metadata files to add items to BBFILES | ||
632 | #data.update_data(self.pkgdata[f]) | ||
633 | #addbbfiles = self.bb_cache.getVar('BBFILES', f, False) or None | ||
634 | #if addbbfiles: | ||
635 | # for aof in addbbfiles.split(): | ||
636 | # if not files.count(aof): | ||
637 | # if not os.path.isabs(aof): | ||
638 | # aof = os.path.join(os.path.dirname(f),aof) | ||
639 | # files.append(aof) | ||
640 | |||
641 | self.bb_cache.handle_data(f, self.status) | ||
642 | |||
643 | # now inform the caller | ||
644 | if progressCallback is not None: | ||
645 | progressCallback( i + 1, len( filelist ), f, fromCache ) | ||
646 | |||
647 | except IOError, e: | ||
648 | self.bb_cache.remove(f) | ||
649 | bb.msg.error(bb.msg.domain.Collection, "opening %s: %s" % (f, e)) | ||
650 | pass | ||
651 | except KeyboardInterrupt: | ||
652 | self.bb_cache.sync() | ||
653 | raise | ||
654 | except Exception, e: | ||
655 | self.bb_cache.remove(f) | ||
656 | bb.msg.error(bb.msg.domain.Collection, "%s while parsing %s" % (e, f)) | ||
657 | except: | ||
658 | self.bb_cache.remove(f) | ||
659 | raise | ||
660 | |||
661 | if progressCallback is not None: | ||
662 | print "\r" # need newline after Handling Bitbake files message | ||
663 | bb.msg.note(1, bb.msg.domain.Collection, "Parsing finished. %d cached, %d parsed, %d skipped, %d masked." % ( cached, parsed, skipped, masked )) | ||
664 | |||
665 | self.bb_cache.sync() | ||
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 9f7e4be4c8..14f1d896d7 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -18,26 +17,26 @@ to have faster update_data and expandKeys operations. | |||
18 | 17 | ||
19 | This is a treade-off between speed and memory again but | 18 | This is a treade-off between speed and memory again but |
20 | the speed is more critical here. | 19 | the speed is more critical here. |
21 | |||
22 | Copyright (C) 2003, 2004 Chris Larson | ||
23 | Copyright (C) 2005 Holger Hans Peter Freyther | ||
24 | |||
25 | This program is free software; you can redistribute it and/or modify it under | ||
26 | the terms of the GNU General Public License as published by the Free Software | ||
27 | Foundation; either version 2 of the License, or (at your option) any later | ||
28 | version. | ||
29 | |||
30 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
31 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
32 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
33 | |||
34 | You should have received a copy of the GNU General Public License along with | ||
35 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
36 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
37 | |||
38 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
39 | """ | 20 | """ |
40 | 21 | ||
22 | # Copyright (C) 2003, 2004 Chris Larson | ||
23 | # Copyright (C) 2005 Holger Hans Peter Freyther | ||
24 | # | ||
25 | # This program is free software; you can redistribute it and/or modify | ||
26 | # it under the terms of the GNU General Public License version 2 as | ||
27 | # published by the Free Software Foundation. | ||
28 | # | ||
29 | # This program is distributed in the hope that it will be useful, | ||
30 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
31 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
32 | # GNU General Public License for more details. | ||
33 | # | ||
34 | # You should have received a copy of the GNU General Public License along | ||
35 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
36 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
37 | # | ||
38 | #Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
39 | |||
41 | import sys, os, re, time, types | 40 | import sys, os, re, time, types |
42 | if sys.argv[0][-5:] == "pydoc": | 41 | if sys.argv[0][-5:] == "pydoc": |
43 | path = os.path.dirname(os.path.dirname(sys.argv[1])) | 42 | path = os.path.dirname(os.path.dirname(sys.argv[1])) |
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index d63fdde3ef..ef1e9dda07 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -6,28 +6,28 @@ BitBake Smart Dictionary Implementation | |||
6 | Functions for interacting with the data structure used by the | 6 | Functions for interacting with the data structure used by the |
7 | BitBake build tools. | 7 | BitBake build tools. |
8 | 8 | ||
9 | Copyright (C) 2003, 2004 Chris Larson | ||
10 | Copyright (C) 2004, 2005 Seb Frankengul | ||
11 | Copyright (C) 2005, 2006 Holger Hans Peter Freyther | ||
12 | Copyright (C) 2005 Uli Luckas | ||
13 | Copyright (C) 2005 ROAD GmbH | ||
14 | |||
15 | This program is free software; you can redistribute it and/or modify it under | ||
16 | the terms of the GNU General Public License as published by the Free Software | ||
17 | Foundation; either version 2 of the License, or (at your option) any later | ||
18 | version. | ||
19 | |||
20 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
21 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
22 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
23 | |||
24 | You should have received a copy of the GNU General Public License along with | ||
25 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
26 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
27 | |||
28 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
29 | """ | 9 | """ |
30 | 10 | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
12 | # Copyright (C) 2004, 2005 Seb Frankengul | ||
13 | # Copyright (C) 2005, 2006 Holger Hans Peter Freyther | ||
14 | # Copyright (C) 2005 Uli Luckas | ||
15 | # Copyright (C) 2005 ROAD GmbH | ||
16 | # | ||
17 | # This program is free software; you can redistribute it and/or modify | ||
18 | # it under the terms of the GNU General Public License version 2 as | ||
19 | # published by the Free Software Foundation. | ||
20 | # | ||
21 | # This program is distributed in the hope that it will be useful, | ||
22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | # GNU General Public License for more details. | ||
25 | # | ||
26 | # You should have received a copy of the GNU General Public License along | ||
27 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
28 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
29 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
30 | |||
31 | import copy, os, re, sys, time, types | 31 | import copy, os, re, sys, time, types |
32 | import bb | 32 | import bb |
33 | from bb import utils, methodpool | 33 | from bb import utils, methodpool |
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index b1d12177c4..f1da98fd45 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -6,23 +5,23 @@ BitBake 'Event' implementation | |||
6 | 5 | ||
7 | Classes and functions for manipulating 'events' in the | 6 | Classes and functions for manipulating 'events' in the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | |||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | """ | 8 | """ |
25 | 9 | ||
10 | # Copyright (C) 2003, 2004 Chris Larson | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | |||
26 | import os, re | 25 | import os, re |
27 | import bb.data | 26 | import bb.data |
28 | import bb.utils | 27 | import bb.utils |
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 3521ece76b..31a4adccb1 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -6,25 +5,25 @@ BitBake 'Fetch' implementations | |||
6 | 5 | ||
7 | Classes for obtaining upstream sources for the | 6 | Classes for obtaining upstream sources for the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | |||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 8 | """ |
27 | 9 | ||
10 | # Copyright (C) 2003, 2004 Chris Larson | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | # | ||
25 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | |||
28 | import os, re | 27 | import os, re |
29 | import bb | 28 | import bb |
30 | from bb import data | 29 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/cvs.py b/bitbake/lib/bb/fetch/cvs.py index 3bdac177eb..bd3317166c 100644 --- a/bitbake/lib/bb/fetch/cvs.py +++ b/bitbake/lib/bb/fetch/cvs.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -7,24 +6,26 @@ BitBake 'Fetch' implementations | |||
7 | Classes for obtaining upstream sources for the | 6 | Classes for obtaining upstream sources for the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | 8 | ||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 9 | """ |
27 | 10 | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
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 | # | ||
26 | #Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | # | ||
28 | |||
28 | import os, re | 29 | import os, re |
29 | import bb | 30 | import bb |
30 | from bb import data | 31 | from bb import data |
@@ -81,6 +82,10 @@ class Cvs(Fetch): | |||
81 | if "localdir" in ud.parm: | 82 | if "localdir" in ud.parm: |
82 | localdir = ud.parm["localdir"] | 83 | localdir = ud.parm["localdir"] |
83 | 84 | ||
85 | cvs_port = "" | ||
86 | if "port" in ud.parm: | ||
87 | cvs_port = ud.parm["port"] | ||
88 | |||
84 | cvs_rsh = None | 89 | cvs_rsh = None |
85 | if method == "ext": | 90 | if method == "ext": |
86 | if "rsh" in ud.parm: | 91 | if "rsh" in ud.parm: |
@@ -92,7 +97,7 @@ class Cvs(Fetch): | |||
92 | cvsroot = ":" + method + ":" + ud.user | 97 | cvsroot = ":" + method + ":" + ud.user |
93 | if ud.pswd: | 98 | if ud.pswd: |
94 | cvsroot += ":" + ud.pswd | 99 | cvsroot += ":" + ud.pswd |
95 | cvsroot += "@" + ud.host + ":" + ud.path | 100 | cvsroot += "@" + ud.host + ":" + cvs_port + ud.path |
96 | 101 | ||
97 | options = [] | 102 | options = [] |
98 | if ud.date: | 103 | if ud.date: |
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index bb517c9928..c0cd27df09 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py | |||
@@ -1,25 +1,25 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
5 | BitBake 'Fetch' git implementation | 4 | BitBake 'Fetch' git implementation |
6 | 5 | ||
7 | Copyright (C) 2005 Richard Purdie | ||
8 | |||
9 | This program is free software; you can redistribute it and/or modify it under | ||
10 | the terms of the GNU General Public License as published by the Free Software | ||
11 | Foundation; either version 2 of the License, or (at your option) any later | ||
12 | version. | ||
13 | |||
14 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
15 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
16 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public License along with | ||
19 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
20 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | """ | 6 | """ |
22 | 7 | ||
8 | #Copyright (C) 2005 Richard Purdie | ||
9 | # | ||
10 | # This program is free software; you can redistribute it and/or modify | ||
11 | # it under the terms of the GNU General Public License version 2 as | ||
12 | # published by the Free Software Foundation. | ||
13 | # | ||
14 | # This program is distributed in the hope that it will be useful, | ||
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | # GNU General Public License for more details. | ||
18 | # | ||
19 | # You should have received a copy of the GNU General Public License along | ||
20 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
22 | |||
23 | import os, re | 23 | import os, re |
24 | import bb | 24 | import bb |
25 | from bb import data | 25 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/local.py b/bitbake/lib/bb/fetch/local.py index 5224976704..9be8f1ce4b 100644 --- a/bitbake/lib/bb/fetch/local.py +++ b/bitbake/lib/bb/fetch/local.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -7,24 +6,25 @@ BitBake 'Fetch' implementations | |||
7 | Classes for obtaining upstream sources for the | 6 | Classes for obtaining upstream sources for the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | 8 | ||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 9 | """ |
27 | 10 | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
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 | # | ||
26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | |||
28 | import os, re | 28 | import os, re |
29 | import bb | 29 | import bb |
30 | from bb import data | 30 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/perforce.py b/bitbake/lib/bb/fetch/perforce.py index 88acf69951..125eb99aa6 100644 --- a/bitbake/lib/bb/fetch/perforce.py +++ b/bitbake/lib/bb/fetch/perforce.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -7,24 +6,25 @@ BitBake 'Fetch' implementations | |||
7 | Classes for obtaining upstream sources for the | 6 | Classes for obtaining upstream sources for the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | 8 | ||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 9 | """ |
27 | 10 | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
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 | # | ||
26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | |||
28 | import os, re | 28 | import os, re |
29 | import bb | 29 | import bb |
30 | from bb import data | 30 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/ssh.py b/bitbake/lib/bb/fetch/ssh.py index e5f69e33e7..81a9892dcc 100644 --- a/bitbake/lib/bb/fetch/ssh.py +++ b/bitbake/lib/bb/fetch/ssh.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | ''' | 3 | ''' |
@@ -11,29 +10,32 @@ IETF secsh internet draft: | |||
11 | Currently does not support the sftp parameters, as this uses scp | 10 | Currently does not support the sftp parameters, as this uses scp |
12 | Also does not support the 'fingerprint' connection parameter. | 11 | Also does not support the 'fingerprint' connection parameter. |
13 | 12 | ||
14 | Copyright (C) 2006 OpenedHand Ltd. | 13 | ''' |
15 | |||
16 | Based in part on svk.py: | ||
17 | Copyright (C) 2006 Holger Hans Peter Freyther | ||
18 | Based on svn.py: | ||
19 | Copyright (C) 2003, 2004 Chris Larson | ||
20 | Based on functions from the base bb module: | ||
21 | Copyright 2003 Holger Schurig | ||
22 | |||
23 | |||
24 | This program is free software; you can redistribute it and/or modify it under | ||
25 | the terms of the GNU General Public License as published by the Free Software | ||
26 | Foundation; either version 2 of the License, or (at your option) any later | ||
27 | version. | ||
28 | 14 | ||
29 | This program is distributed in the hope that it will be useful, but WITHOUT | 15 | # Copyright (C) 2006 OpenedHand Ltd. |
30 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 16 | # |
31 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 17 | # |
18 | # Based in part on svk.py: | ||
19 | # Copyright (C) 2006 Holger Hans Peter Freyther | ||
20 | # Based on svn.py: | ||
21 | # Copyright (C) 2003, 2004 Chris Larson | ||
22 | # Based on functions from the base bb module: | ||
23 | # Copyright 2003 Holger Schurig | ||
24 | # | ||
25 | # | ||
26 | # This program is free software; you can redistribute it and/or modify | ||
27 | # it under the terms of the GNU General Public License version 2 as | ||
28 | # published by the Free Software Foundation. | ||
29 | # | ||
30 | # This program is distributed in the hope that it will be useful, | ||
31 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
32 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
33 | # GNU General Public License for more details. | ||
34 | # | ||
35 | # You should have received a copy of the GNU General Public License along | ||
36 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
37 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
32 | 38 | ||
33 | You should have received a copy of the GNU General Public License along with | ||
34 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
35 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
36 | ''' | ||
37 | import re, os | 39 | import re, os |
38 | import bb | 40 | import bb |
39 | from bb import data | 41 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/svk.py b/bitbake/lib/bb/fetch/svk.py index 29270ab3d8..d863ccb6e0 100644 --- a/bitbake/lib/bb/fetch/svk.py +++ b/bitbake/lib/bb/fetch/svk.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -6,33 +5,26 @@ BitBake 'Fetch' implementations | |||
6 | 5 | ||
7 | This implementation is for svk. It is based on the svn implementation | 6 | This implementation is for svk. It is based on the svn implementation |
8 | 7 | ||
9 | Copyright (C) 2006 Holger Hans Peter Freyther | ||
10 | |||
11 | GPL and MIT licensed | ||
12 | |||
13 | |||
14 | |||
15 | Classes for obtaining upstream sources for the | ||
16 | BitBake build tools. | ||
17 | |||
18 | Copyright (C) 2003, 2004 Chris Larson | ||
19 | |||
20 | This program is free software; you can redistribute it and/or modify it under | ||
21 | the terms of the GNU General Public License as published by the Free Software | ||
22 | Foundation; either version 2 of the License, or (at your option) any later | ||
23 | version. | ||
24 | |||
25 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
26 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
27 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
28 | |||
29 | You should have received a copy of the GNU General Public License along with | ||
30 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
31 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
32 | |||
33 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
34 | """ | 8 | """ |
35 | 9 | ||
10 | # Copyright (C) 2006 Holger Hans Peter Freyther | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
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 | # | ||
26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | |||
36 | import os, re | 28 | import os, re |
37 | import bb | 29 | import bb |
38 | from bb import data | 30 | from bb import data |
diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py index ebd5bebab7..21be1412a6 100644 --- a/bitbake/lib/bb/fetch/svn.py +++ b/bitbake/lib/bb/fetch/svn.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -6,29 +5,29 @@ BitBake 'Fetch' implementations | |||
6 | 5 | ||
7 | This implementation is for svn. It is based on the cvs implementation. | 6 | This implementation is for svn. It is based on the cvs implementation. |
8 | 7 | ||
9 | Copyright (C) 2004 Marcin Juszkiewicz | ||
10 | |||
11 | Classes for obtaining upstream sources for the | ||
12 | BitBake build tools. | ||
13 | |||
14 | Copyright (C) 2003, 2004 Chris Larson | ||
15 | |||
16 | This program is free software; you can redistribute it and/or modify it under | ||
17 | the terms of the GNU General Public License as published by the Free Software | ||
18 | Foundation; either version 2 of the License, or (at your option) any later | ||
19 | version. | ||
20 | |||
21 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
22 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
23 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
24 | |||
25 | You should have received a copy of the GNU General Public License along with | ||
26 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
27 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
28 | |||
29 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
30 | """ | 8 | """ |
31 | 9 | ||
10 | # Copyright (C) 2004 Marcin Juszkiewicz | ||
11 | # | ||
12 | # Classes for obtaining upstream sources for the | ||
13 | # BitBake build tools. | ||
14 | # Copyright (C) 2003, 2004 Chris Larson | ||
15 | # | ||
16 | # This program is free software; you can redistribute it and/or modify | ||
17 | # it under the terms of the GNU General Public License version 2 as | ||
18 | # published by the Free Software Foundation. | ||
19 | # | ||
20 | # This program is distributed in the hope that it will be useful, | ||
21 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | # GNU General Public License for more details. | ||
24 | # | ||
25 | # You should have received a copy of the GNU General Public License along | ||
26 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
28 | # | ||
29 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
30 | |||
32 | import os, re | 31 | import os, re |
33 | import sys | 32 | import sys |
34 | import bb | 33 | import bb |
diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py index 9c9c1675a1..2d590ad0b2 100644 --- a/bitbake/lib/bb/fetch/wget.py +++ b/bitbake/lib/bb/fetch/wget.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -7,24 +6,25 @@ BitBake 'Fetch' implementations | |||
7 | Classes for obtaining upstream sources for the | 6 | Classes for obtaining upstream sources for the |
8 | BitBake build tools. | 7 | BitBake build tools. |
9 | 8 | ||
10 | Copyright (C) 2003, 2004 Chris Larson | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 9 | """ |
27 | 10 | ||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
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 | # | ||
26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | |||
28 | import os, re | 28 | import os, re |
29 | import bb | 29 | import bb |
30 | from bb import data | 30 | from bb import data |
diff --git a/bitbake/lib/bb/manifest.py b/bitbake/lib/bb/manifest.py index 30bb454724..4e4b7d98ec 100644 --- a/bitbake/lib/bb/manifest.py +++ b/bitbake/lib/bb/manifest.py | |||
@@ -3,18 +3,18 @@ | |||
3 | # | 3 | # |
4 | # Copyright (C) 2003, 2004 Chris Larson | 4 | # Copyright (C) 2003, 2004 Chris Larson |
5 | # | 5 | # |
6 | # This program is free software; you can redistribute it and/or modify it under | 6 | # This program is free software; you can redistribute it and/or modify |
7 | # the terms of the GNU General Public License as published by the Free Software | 7 | # it under the terms of the GNU General Public License version 2 as |
8 | # Foundation; either version 2 of the License, or (at your option) any later | 8 | # published by the Free Software Foundation. |
9 | # version. | 9 | # |
10 | # | 10 | # This program is distributed in the hope that it will be useful, |
11 | # This program is distributed in the hope that it will be useful, but WITHOUT | 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 13 | # GNU General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU General Public License along with | 15 | # You should have received a copy of the GNU General Public License along |
16 | # this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 16 | # with this program; if not, write to the Free Software Foundation, Inc., |
17 | # Place, Suite 330, Boston, MA 02111-1307 USA. | 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 | 18 | ||
19 | import os, sys | 19 | import os, sys |
20 | import bb, bb.data | 20 | import bb, bb.data |
diff --git a/bitbake/lib/bb/methodpool.py b/bitbake/lib/bb/methodpool.py index f0565ce790..f43c4a0580 100644 --- a/bitbake/lib/bb/methodpool.py +++ b/bitbake/lib/bb/methodpool.py | |||
@@ -3,34 +3,19 @@ | |||
3 | # | 3 | # |
4 | # | 4 | # |
5 | # Copyright (C) 2006 Holger Hans Peter Freyther | 5 | # Copyright (C) 2006 Holger Hans Peter Freyther |
6 | # All rights reserved. | ||
7 | # | 6 | # |
8 | # Redistribution and use in source and binary forms, with or without | 7 | # This program is free software; you can redistribute it and/or modify |
9 | # modification, are permitted provided that the following conditions are met: | 8 | # it under the terms of the GNU General Public License version 2 as |
9 | # published by the Free Software Foundation. | ||
10 | # | 10 | # |
11 | # Redistributions of source code must retain the above copyright notice, | 11 | # This program is distributed in the hope that it will be useful, |
12 | # this list of conditions and the following disclaimer. | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
13 | # | 15 | # |
14 | # Redistributions in binary form must reproduce the above copyright | 16 | # You should have received a copy of the GNU General Public License along |
15 | # notice, this list of conditions and the following disclaimer in the | 17 | # with this program; if not, write to the Free Software Foundation, Inc., |
16 | # documentation and/or other materials provided with the distribution. | 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 | # | ||
18 | # Neither the name Holger Hans Peter Freyther nor the names of its | ||
19 | # contributors may be used to endorse or promote products derived | ||
20 | # from this software without specific prior written permission. | ||
21 | # | ||
22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
23 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
24 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
25 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
26 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
27 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
29 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
30 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
31 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
32 | # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
33 | # POSSIBILITY OF SUCH DAMAGE. | ||
34 | 19 | ||
35 | 20 | ||
36 | """ | 21 | """ |
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 473851cc72..bd7729731a 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """ | 3 | """ |
@@ -6,23 +5,23 @@ BitBake 'msg' implementation | |||
6 | 5 | ||
7 | Message handling infrastructure for bitbake | 6 | Message handling infrastructure for bitbake |
8 | 7 | ||
9 | # Copyright (C) 2006 Richard Purdie | ||
10 | |||
11 | This program is free software; you can redistribute it and/or modify it under | ||
12 | the terms of the GNU General Public License as published by the Free Software | ||
13 | Foundation; either version 2 of the License, or (at your option) any later | ||
14 | version. | ||
15 | |||
16 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
18 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
19 | |||
20 | You should have received a copy of the GNU General Public License along with | ||
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
22 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | |||
24 | """ | 8 | """ |
25 | 9 | ||
10 | # Copyright (C) 2006 Richard Purdie | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | |||
26 | import sys, os, re, bb | 25 | import sys, os, re, bb |
27 | from bb import utils | 26 | from bb import utils |
28 | 27 | ||
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 70fdba03b4..3c9ba8e6da 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -3,24 +3,26 @@ BitBake Parsers | |||
3 | 3 | ||
4 | File parsers for the BitBake build tools. | 4 | File parsers for the BitBake build tools. |
5 | 5 | ||
6 | Copyright (C) 2003, 2004 Chris Larson | 6 | """ |
7 | Copyright (C) 2003, 2004 Phil Blundell | ||
8 | |||
9 | This program is free software; you can redistribute it and/or modify it under | ||
10 | the terms of the GNU General Public License as published by the Free Software | ||
11 | Foundation; either version 2 of the License, or (at your option) any later | ||
12 | version. | ||
13 | |||
14 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
15 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
16 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
17 | 7 | ||
18 | You should have received a copy of the GNU General Public License along with | ||
19 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
20 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | 8 | ||
22 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | 9 | # Copyright (C) 2003, 2004 Chris Larson |
23 | """ | 10 | # Copyright (C) 2003, 2004 Phil Blundell |
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | # | ||
25 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
24 | 26 | ||
25 | __all__ = [ 'ParseError', 'SkipPackage', 'cached_mtime', 'mark_dependency', | 27 | __all__ = [ 'ParseError', 'SkipPackage', 'cached_mtime', 'mark_dependency', |
26 | 'supports', 'handle', 'init' ] | 28 | 'supports', 'handle', 'init' ] |
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 42b0369428..2c39316325 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -1,25 +1,29 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | # ex:ts=4:sw=4:sts=4:et | 2 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """class for handling .bb files | 4 | """ |
5 | class for handling .bb files | ||
5 | 6 | ||
6 | Reads a .bb file and obtains its metadata | 7 | Reads a .bb file and obtains its metadata |
7 | 8 | ||
8 | Copyright (C) 2003, 2004 Chris Larson | 9 | """ |
9 | Copyright (C) 2003, 2004 Phil Blundell | 10 | |
10 | 11 | ||
11 | This program is free software; you can redistribute it and/or modify it under | 12 | # Copyright (C) 2003, 2004 Chris Larson |
12 | the terms of the GNU General Public License as published by the Free Software | 13 | # Copyright (C) 2003, 2004 Phil Blundell |
13 | Foundation; either version 2 of the License, or (at your option) any later | 14 | # |
14 | version. | 15 | # This program is free software; you can redistribute it and/or modify |
15 | 16 | # it under the terms of the GNU General Public License version 2 as | |
16 | This program is distributed in the hope that it will be useful, but WITHOUT | 17 | # published by the Free Software Foundation. |
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 18 | # |
18 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 19 | # This program is distributed in the hope that it will be useful, |
19 | 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | You should have received a copy of the GNU General Public License along with | 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 22 | # GNU General Public License for more details. |
22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" | 23 | # |
24 | # You should have received a copy of the GNU General Public License along | ||
25 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
23 | 27 | ||
24 | import re, bb, os, sys, time | 28 | import re, bb, os, sys, time |
25 | import bb.fetch, bb.build, bb.utils | 29 | import bb.fetch, bb.build, bb.utils |
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 6c0a8cceaf..1ae673079d 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -1,25 +1,28 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | # ex:ts=4:sw=4:sts=4:et | 2 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | """class for handling configuration data files | 4 | """ |
5 | class for handling configuration data files | ||
5 | 6 | ||
6 | Reads a .conf file and obtains its metadata | 7 | Reads a .conf file and obtains its metadata |
7 | 8 | ||
8 | Copyright (C) 2003, 2004 Chris Larson | 9 | """ |
9 | Copyright (C) 2003, 2004 Phil Blundell | 10 | |
10 | 11 | # Copyright (C) 2003, 2004 Chris Larson | |
11 | This program is free software; you can redistribute it and/or modify it under | 12 | # Copyright (C) 2003, 2004 Phil Blundell |
12 | the terms of the GNU General Public License as published by the Free Software | 13 | # |
13 | Foundation; either version 2 of the License, or (at your option) any later | 14 | # This program is free software; you can redistribute it and/or modify |
14 | version. | 15 | # it under the terms of the GNU General Public License version 2 as |
15 | 16 | # published by the Free Software Foundation. | |
16 | This program is distributed in the hope that it will be useful, but WITHOUT | 17 | # |
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 18 | # This program is distributed in the hope that it will be useful, |
18 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | You should have received a copy of the GNU General Public License along with | 21 | # GNU General Public License for more details. |
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 22 | # |
22 | Place, Suite 330, Boston, MA 02111-1307 USA.""" | 23 | # You should have received a copy of the GNU General Public License along |
24 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
23 | 26 | ||
24 | import re, bb.data, os, sys | 27 | import re, bb.data, os, sys |
25 | from bb.parse import ParseError | 28 | from bb.parse import ParseError |
diff --git a/bitbake/lib/bb/parse/parse_py/__init__.py b/bitbake/lib/bb/parse/parse_py/__init__.py index 6a2ce4059d..9e0e00adda 100644 --- a/bitbake/lib/bb/parse/parse_py/__init__.py +++ b/bitbake/lib/bb/parse/parse_py/__init__.py | |||
@@ -6,24 +6,25 @@ BitBake Parsers | |||
6 | 6 | ||
7 | File parsers for the BitBake build tools. | 7 | File parsers for the BitBake build tools. |
8 | 8 | ||
9 | Copyright (C) 2003, 2004 Chris Larson | ||
10 | Copyright (C) 2003, 2004 Phil Blundell | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify it under | ||
13 | the terms of the GNU General Public License as published by the Free Software | ||
14 | Foundation; either version 2 of the License, or (at your option) any later | ||
15 | version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
18 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
19 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License along with | ||
22 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
23 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | |||
25 | Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
26 | """ | 9 | """ |
10 | |||
11 | # Copyright (C) 2003, 2004 Chris Larson | ||
12 | # Copyright (C) 2003, 2004 Phil Blundell | ||
13 | # | ||
14 | # This program is free software; you can redistribute it and/or modify | ||
15 | # it under the terms of the GNU General Public License version 2 as | ||
16 | # published by the Free Software Foundation. | ||
17 | # | ||
18 | # This program is distributed in the hope that it will be useful, | ||
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | # GNU General Public License for more details. | ||
22 | # | ||
23 | # You should have received a copy of the GNU General Public License along | ||
24 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
26 | # | ||
27 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | ||
27 | __version__ = '1.0' | 28 | __version__ = '1.0' |
28 | 29 | ||
29 | __all__ = [ 'ConfHandler', 'BBHandler'] | 30 | __all__ = [ 'ConfHandler', 'BBHandler'] |
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py index 3cb7cc1f07..fdd6cd10d1 100644 --- a/bitbake/lib/bb/providers.py +++ b/bitbake/lib/bb/providers.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | # | 3 | # |
@@ -9,18 +8,18 @@ | |||
9 | # Copyright (C) 2005 ROAD GmbH | 8 | # Copyright (C) 2005 ROAD GmbH |
10 | # Copyright (C) 2006 Richard Purdie | 9 | # Copyright (C) 2006 Richard Purdie |
11 | # | 10 | # |
12 | # This program is free software; you can redistribute it and/or modify it under | 11 | # This program is free software; you can redistribute it and/or modify |
13 | # the terms of the GNU General Public License as published by the Free Software | 12 | # it under the terms of the GNU General Public License version 2 as |
14 | # Foundation; either version 2 of the License, or (at your option) any later | 13 | # published by the Free Software Foundation. |
15 | # version. | ||
16 | # | 14 | # |
17 | # This program is distributed in the hope that it will be useful, but WITHOUT | 15 | # This program is distributed in the hope that it will be useful, |
18 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | # GNU General Public License for more details. | ||
20 | # | 19 | # |
21 | # You should have received a copy of the GNU General Public License along with | 20 | # You should have received a copy of the GNU General Public License along |
22 | # this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 21 | # with this program; if not, write to the Free Software Foundation, Inc., |
23 | # Place, Suite 330, Boston, MA 02111-1307 USA. | 22 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
24 | 23 | ||
25 | import os, re | 24 | import os, re |
26 | from bb import data, utils | 25 | from bb import data, utils |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 4da543ffc8..2ef2670da0 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -5,20 +5,23 @@ | |||
5 | BitBake 'RunQueue' implementation | 5 | BitBake 'RunQueue' implementation |
6 | 6 | ||
7 | Handles preparation and execution of a queue of tasks | 7 | Handles preparation and execution of a queue of tasks |
8 | |||
9 | Copyright (C) 2006 Richard Purdie | ||
10 | |||
11 | This program is free software; you can redistribute it and/or modify it under | ||
12 | the terms of the GNU General Public License version 2 as published by the Free | ||
13 | Software Foundation | ||
14 | |||
15 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
17 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
18 | |||
19 | You should have received a copy of the GNU General Public License along with | ||
20 | """ | 8 | """ |
21 | 9 | ||
10 | # Copyright (C) 2006 Richard Purdie | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License version 2 as | ||
14 | # published by the Free Software Foundation. | ||
15 | # | ||
16 | # This program is distributed in the hope that it will be useful, | ||
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | # GNU General Public License for more details. | ||
20 | # | ||
21 | # You should have received a copy of the GNU General Public License along | ||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | |||
22 | from bb import msg, data, fetch, event, mkdirhier, utils | 25 | from bb import msg, data, fetch, event, mkdirhier, utils |
23 | from sets import Set | 26 | from sets import Set |
24 | import bb, os, sys | 27 | import bb, os, sys |
@@ -48,7 +51,7 @@ class RunQueue: | |||
48 | taskname = self.runq_task[task] | 51 | taskname = self.runq_task[task] |
49 | return "%s, %s" % (fn, taskname) | 52 | return "%s, %s" % (fn, taskname) |
50 | 53 | ||
51 | def prepare_runqueue(self, cfgData, dataCache, taskData, targets): | 54 | def prepare_runqueue(self, cooker, cfgData, dataCache, taskData, targets): |
52 | """ | 55 | """ |
53 | Turn a set of taskData into a RunQueue and compute data needed | 56 | Turn a set of taskData into a RunQueue and compute data needed |
54 | to optimise the execution order. | 57 | to optimise the execution order. |
@@ -104,9 +107,13 @@ class RunQueue: | |||
104 | depdata = taskData.build_targets[depid][0] | 107 | depdata = taskData.build_targets[depid][0] |
105 | if depdata: | 108 | if depdata: |
106 | dep = taskData.fn_index[depdata] | 109 | dep = taskData.fn_index[depdata] |
107 | taskid = taskData.gettask_id(dep, taskname) | 110 | # Need to avoid creating new tasks here |
108 | depends.append(taskid) | 111 | taskid = taskData.gettask_id(dep, taskname, False) |
109 | fnid = taskData.tasks_fnid[taskid] | 112 | if taskid: |
113 | depends.append(taskid) | ||
114 | fnid = taskData.tasks_fnid[taskid] | ||
115 | else: | ||
116 | fnid = taskData.getfn_id(dep) | ||
110 | for nextdepid in taskData.depids[fnid]: | 117 | for nextdepid in taskData.depids[fnid]: |
111 | if nextdepid not in dep_seen: | 118 | if nextdepid not in dep_seen: |
112 | add_recursive_build(nextdepid) | 119 | add_recursive_build(nextdepid) |
@@ -127,9 +134,13 @@ class RunQueue: | |||
127 | depdata = taskData.run_targets[rdepid][0] | 134 | depdata = taskData.run_targets[rdepid][0] |
128 | if depdata: | 135 | if depdata: |
129 | dep = taskData.fn_index[depdata] | 136 | dep = taskData.fn_index[depdata] |
130 | taskid = taskData.gettask_id(dep, taskname) | 137 | # Need to avoid creating new tasks here |
131 | depends.append(taskid) | 138 | taskid = taskData.gettask_id(dep, taskname, False) |
132 | fnid = taskData.tasks_fnid[taskid] | 139 | if taskid: |
140 | depends.append(taskid) | ||
141 | fnid = taskData.tasks_fnid[taskid] | ||
142 | else: | ||
143 | fnid = taskData.getfn_id(dep) | ||
133 | for nextdepid in taskData.depids[fnid]: | 144 | for nextdepid in taskData.depids[fnid]: |
134 | if nextdepid not in dep_seen: | 145 | if nextdepid not in dep_seen: |
135 | add_recursive_build(nextdepid) | 146 | add_recursive_build(nextdepid) |
@@ -143,11 +154,11 @@ class RunQueue: | |||
143 | if 'recrdeptask' in task_deps and taskData.tasks_name[task] in task_deps['recrdeptask']: | 154 | if 'recrdeptask' in task_deps and taskData.tasks_name[task] in task_deps['recrdeptask']: |
144 | dep_seen = [] | 155 | dep_seen = [] |
145 | rdep_seen = [] | 156 | rdep_seen = [] |
146 | taskname = task_deps['recrdeptask'][taskData.tasks_name[task]] | 157 | for taskname in task_deps['recrdeptask'][taskData.tasks_name[task]].split(): |
147 | for depid in taskData.depids[fnid]: | 158 | for depid in taskData.depids[fnid]: |
148 | add_recursive_build(depid) | 159 | add_recursive_build(depid) |
149 | for rdepid in taskData.rdepids[fnid]: | 160 | for rdepid in taskData.rdepids[fnid]: |
150 | add_recursive_run(rdepid) | 161 | add_recursive_run(rdepid) |
151 | 162 | ||
152 | #Prune self references | 163 | #Prune self references |
153 | if task in depends: | 164 | if task in depends: |
@@ -188,13 +199,21 @@ class RunQueue: | |||
188 | 199 | ||
189 | for target in targets: | 200 | for target in targets: |
190 | targetid = taskData.getbuild_id(target[0]) | 201 | targetid = taskData.getbuild_id(target[0]) |
191 | if targetid in taskData.failed_deps: | ||
192 | continue | ||
193 | 202 | ||
194 | if targetid not in taskData.build_targets: | 203 | if targetid not in taskData.build_targets: |
195 | continue | 204 | continue |
196 | 205 | ||
197 | fnid = taskData.build_targets[targetid][0] | 206 | fnid = taskData.build_targets[targetid][0] |
207 | |||
208 | # Remove stamps for targets if force mode active | ||
209 | if cooker.configuration.force: | ||
210 | fn = taskData.fn_index[fnid] | ||
211 | bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (target[1], fn)) | ||
212 | bb.build.del_stamp(target[1], dataCache, fn) | ||
213 | |||
214 | if targetid in taskData.failed_deps: | ||
215 | continue | ||
216 | |||
198 | if fnid in taskData.failed_fnids: | 217 | if fnid in taskData.failed_fnids: |
199 | continue | 218 | continue |
200 | 219 | ||
@@ -338,10 +357,13 @@ class RunQueue: | |||
338 | 357 | ||
339 | bb.msg.note(1, bb.msg.domain.RunQueue, "Executing runqueue") | 358 | bb.msg.note(1, bb.msg.domain.RunQueue, "Executing runqueue") |
340 | 359 | ||
360 | active_builds = 0 | ||
361 | tasks_completed = 0 | ||
362 | tasks_skipped = 0 | ||
363 | |||
341 | runq_buildable = [] | 364 | runq_buildable = [] |
342 | runq_running = [] | 365 | runq_running = [] |
343 | runq_complete = [] | 366 | runq_complete = [] |
344 | active_builds = 0 | ||
345 | build_pids = {} | 367 | build_pids = {} |
346 | failed_fnids = [] | 368 | failed_fnids = [] |
347 | 369 | ||
@@ -405,15 +427,15 @@ class RunQueue: | |||
405 | fn = taskData.fn_index[self.runq_fnid[task]] | 427 | fn = taskData.fn_index[self.runq_fnid[task]] |
406 | taskname = self.runq_task[task] | 428 | taskname = self.runq_task[task] |
407 | 429 | ||
408 | if bb.build.stamp_is_current_cache(dataCache, fn, taskname): | 430 | if bb.build.stamp_is_current(taskname, dataCache, fn): |
409 | targetid = taskData.gettask_id(fn, taskname) | 431 | bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task, taskData))) |
410 | if not (targetid in taskData.external_targets and cooker.configuration.force): | 432 | runq_running[task] = 1 |
411 | bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task, taskData))) | 433 | task_complete(self, task) |
412 | runq_running[task] = 1 | 434 | tasks_completed = tasks_completed + 1 |
413 | task_complete(self, task) | 435 | tasks_skipped = tasks_skipped + 1 |
414 | continue | 436 | continue |
415 | 437 | ||
416 | bb.msg.debug(1, bb.msg.domain.RunQueue, "Running task %s (%s)" % (task, self.get_user_idstring(task, taskData))) | 438 | bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (tasks_completed + active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task, taskData))) |
417 | try: | 439 | try: |
418 | pid = os.fork() | 440 | pid = os.fork() |
419 | except OSError, e: | 441 | except OSError, e: |
@@ -451,6 +473,7 @@ class RunQueue: | |||
451 | failed_fnids.append(self.runq_fnid[task]) | 473 | failed_fnids.append(self.runq_fnid[task]) |
452 | break | 474 | break |
453 | task_complete(self, task) | 475 | task_complete(self, task) |
476 | tasks_completed = tasks_completed + 1 | ||
454 | del build_pids[result[0]] | 477 | del build_pids[result[0]] |
455 | continue | 478 | continue |
456 | break | 479 | break |
@@ -486,6 +509,8 @@ class RunQueue: | |||
486 | if runq_complete[task] == 0: | 509 | if runq_complete[task] == 0: |
487 | bb.msg.error(bb.msg.domain.RunQueue, "Task %s never completed!" % task) | 510 | bb.msg.error(bb.msg.domain.RunQueue, "Task %s never completed!" % task) |
488 | 511 | ||
512 | bb.msg.note(1, bb.msg.domain.RunQueue, "Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed." % (tasks_completed, tasks_skipped, len(failed_fnids))) | ||
513 | |||
489 | return failed_fnids | 514 | return failed_fnids |
490 | 515 | ||
491 | def dump_data(self, taskQueue): | 516 | def dump_data(self, taskQueue): |
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py index cb8e97b715..32a773064b 100644 --- a/bitbake/lib/bb/shell.py +++ b/bitbake/lib/bb/shell.py | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # ex:ts=4:sw=4:sts=4:et | 1 | # ex:ts=4:sw=4:sts=4:et |
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | ########################################################################## | 3 | ########################################################################## |
@@ -6,17 +5,18 @@ | |||
6 | # Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de> | 5 | # Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de> |
7 | # Copyright (C) 2005-2006 Vanille Media | 6 | # Copyright (C) 2005-2006 Vanille Media |
8 | # | 7 | # |
9 | # This program is free software; you can redistribute it and/or modify it under | 8 | # This program is free software; you can redistribute it and/or modify |
10 | # the terms of the GNU General Public License as published by the Free Software | 9 | # it under the terms of the GNU General Public License version 2 as |
11 | # Foundation; version 2 of the License. | 10 | # published by the Free Software Foundation. |
12 | # | 11 | # |
13 | # This program is distributed in the hope that it will be useful, but WITHOUT | 12 | # This program is distributed in the hope that it will be useful, |
14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU General Public License for more details. | ||
16 | # | 16 | # |
17 | # You should have received a copy of the GNU General Public License along with | 17 | # You should have received a copy of the GNU General Public License along |
18 | # this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 18 | # with this program; if not, write to the Free Software Foundation, Inc., |
19 | # Place, Suite 330, Boston, MA 02111-1307 USA. | 19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | # | 20 | # |
21 | ########################################################################## | 21 | ########################################################################## |
22 | # | 22 | # |
@@ -171,7 +171,7 @@ class BitBakeShellCommands: | |||
171 | td.add_unresolved(cooker.configuration.data, cooker.status) | 171 | td.add_unresolved(cooker.configuration.data, cooker.status) |
172 | 172 | ||
173 | rq = runqueue.RunQueue() | 173 | rq = runqueue.RunQueue() |
174 | rq.prepare_runqueue(cooker.configuration.data, cooker.status, td, tasks) | 174 | rq.prepare_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks) |
175 | rq.execute_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks) | 175 | rq.execute_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks) |
176 | 176 | ||
177 | except Providers.NoProvider: | 177 | except Providers.NoProvider: |
@@ -255,6 +255,11 @@ class BitBakeShellCommands: | |||
255 | except parse.ParseError: | 255 | except parse.ParseError: |
256 | print "ERROR: Unable to open or parse '%s'" % bf | 256 | print "ERROR: Unable to open or parse '%s'" % bf |
257 | else: | 257 | else: |
258 | # Remove stamp for target if force mode active | ||
259 | if cooker.configuration.force: | ||
260 | bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (cmd, bf)) | ||
261 | bb.build.del_stamp('do_%s' % cmd, bbfile_data) | ||
262 | |||
258 | item = data.getVar('PN', bbfile_data, 1) | 263 | item = data.getVar('PN', bbfile_data, 1) |
259 | data.setVar( "_task_cache", [], bbfile_data ) # force | 264 | data.setVar( "_task_cache", [], bbfile_data ) # force |
260 | try: | 265 | try: |
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 | ||
7 | Task data collection and handling | 7 | Task data collection and handling |
8 | 8 | ||
9 | Copyright (C) 2006 Richard Purdie | ||
10 | |||
11 | This program is free software; you can redistribute it and/or modify it under | ||
12 | the terms of the GNU General Public License version 2 as published by the Free | ||
13 | Software Foundation | ||
14 | |||
15 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
17 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
18 | |||
19 | You 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 | |||
22 | from bb import data, fetch, event, mkdirhier, utils | 26 | from bb import data, fetch, event, mkdirhier, utils |
23 | import bb, os | 27 | import 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 | """ |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index d7383f44b2..411f43a105 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -2,23 +2,23 @@ | |||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
3 | """ | 3 | """ |
4 | BitBake Utility Functions | 4 | BitBake Utility Functions |
5 | |||
6 | This program is free software; you can redistribute it and/or modify it under | ||
7 | the terms of the GNU General Public License as published by the Free Software | ||
8 | Foundation; either version 2 of the License, or (at your option) any later | ||
9 | version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
13 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License along with | ||
16 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
17 | Place, Suite 330, Boston, MA 02111-1307 USA. | ||
18 | |||
19 | This file is part of the BitBake build tools. | ||
20 | """ | 5 | """ |
21 | 6 | ||
7 | # Copyright (C) 2004 Michael Lauer | ||
8 | # | ||
9 | # This program is free software; you can redistribute it and/or modify | ||
10 | # it under the terms of the GNU General Public License version 2 as | ||
11 | # published by the Free Software Foundation. | ||
12 | # | ||
13 | # This program is distributed in the hope that it will be useful, | ||
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | # GNU General Public License for more details. | ||
17 | # | ||
18 | # You should have received a copy of the GNU General Public License along | ||
19 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
21 | |||
22 | digits = "0123456789" | 22 | digits = "0123456789" |
23 | ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" | 23 | ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
24 | 24 | ||