summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-01-08 23:53:01 (GMT)
committerRichard Purdie <richard@openedhand.com>2007-01-08 23:53:01 (GMT)
commitf5665d5bfcfb13d01da9e4c7d5046453e80f7baf (patch)
treeb8908549afaf3006bf3763419711090ac999c2a4
parentaec95de5f7dca2afa3a4a0bdb0d4d553c13f680d (diff)
downloadpoky-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
-rw-r--r--bitbake/AUTHORS4
-rw-r--r--bitbake/COPYING339
-rw-r--r--bitbake/HEADER19
-rw-r--r--bitbake/MANIFEST1
-rwxr-xr-xbitbake/bin/bbimage24
-rwxr-xr-xbitbake/bin/bitbake679
-rwxr-xr-xbitbake/bin/bitdoc28
-rw-r--r--bitbake/doc/COPYING.GPL27
-rw-r--r--bitbake/doc/bitbake.1117
-rw-r--r--bitbake/lib/bb/COW.py29
-rw-r--r--bitbake/lib/bb/__init__.py42
-rw-r--r--bitbake/lib/bb/build.py193
-rw-r--r--bitbake/lib/bb/cache.py36
-rw-r--r--bitbake/lib/bb/cooker.py665
-rw-r--r--bitbake/lib/bb/data.py37
-rw-r--r--bitbake/lib/bb/data_smart.py40
-rw-r--r--bitbake/lib/bb/event.py31
-rw-r--r--bitbake/lib/bb/fetch/__init__.py35
-rw-r--r--bitbake/lib/bb/fetch/cvs.py41
-rw-r--r--bitbake/lib/bb/fetch/git.py30
-rw-r--r--bitbake/lib/bb/fetch/local.py34
-rw-r--r--bitbake/lib/bb/fetch/perforce.py34
-rw-r--r--bitbake/lib/bb/fetch/ssh.py46
-rw-r--r--bitbake/lib/bb/fetch/svk.py44
-rw-r--r--bitbake/lib/bb/fetch/svn.py43
-rw-r--r--bitbake/lib/bb/fetch/wget.py34
-rw-r--r--bitbake/lib/bb/manifest.py24
-rw-r--r--bitbake/lib/bb/methodpool.py35
-rw-r--r--bitbake/lib/bb/msg.py31
-rw-r--r--bitbake/lib/bb/parse/__init__.py34
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py36
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py35
-rw-r--r--bitbake/lib/bb/parse/parse_py/__init__.py35
-rw-r--r--bitbake/lib/bb/providers.py21
-rw-r--r--bitbake/lib/bb/runqueue.py95
-rw-r--r--bitbake/lib/bb/shell.py27
-rw-r--r--bitbake/lib/bb/taskdata.py35
-rw-r--r--bitbake/lib/bb/utils.py30
-rwxr-xr-xbitbake/setup.py69
39 files changed, 1815 insertions, 1344 deletions
diff --git a/bitbake/AUTHORS b/bitbake/AUTHORS
index ef119cc..97d4468 100644
--- a/bitbake/AUTHORS
+++ b/bitbake/AUTHORS
@@ -1,6 +1,10 @@
1Tim Ansell <mithro@mithis.net>
1Phil Blundell <pb@handhelds.org> 2Phil Blundell <pb@handhelds.org>
3Seb Frankengul <seb@frankengul.org>
2Holger Freyther <zecke@handhelds.org> 4Holger Freyther <zecke@handhelds.org>
5Marcin Juszkiewicz <hrw@hrw.one.pl>
3Chris Larson <kergoth@handhelds.org> 6Chris Larson <kergoth@handhelds.org>
7Ulrich Luckas <luckas@musoft.de>
4Mickey Lauer <mickey@Vanille.de> 8Mickey Lauer <mickey@Vanille.de>
5Richard Purdie <rpurdie@rpsys.net> 9Richard Purdie <rpurdie@rpsys.net>
6Holger Schurig <holgerschurig@gmx.de> 10Holger Schurig <holgerschurig@gmx.de>
diff --git a/bitbake/COPYING b/bitbake/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/bitbake/COPYING
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/bitbake/HEADER b/bitbake/HEADER
new file mode 100644
index 0000000..9859255
--- /dev/null
+++ b/bitbake/HEADER
@@ -0,0 +1,19 @@
1# ex:ts=4:sw=4:sts=4:et
2# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
3#
4# <one line to give the program's name and a brief idea of what it does.>
5# Copyright (C) <year> <name of author>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
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.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
diff --git a/bitbake/MANIFEST b/bitbake/MANIFEST
index f088792..0440a4e 100644
--- a/bitbake/MANIFEST
+++ b/bitbake/MANIFEST
@@ -9,6 +9,7 @@ lib/bb/COW.py
9lib/bb/__init__.py 9lib/bb/__init__.py
10lib/bb/build.py 10lib/bb/build.py
11lib/bb/cache.py 11lib/bb/cache.py
12lib/bb/cooker.py
12lib/bb/data.py 13lib/bb/data.py
13lib/bb/data_smart.py 14lib/bb/data_smart.py
14lib/bb/event.py 15lib/bb/event.py
diff --git a/bitbake/bin/bbimage b/bitbake/bin/bbimage
index 9adedbf..fdc4176 100755
--- a/bitbake/bin/bbimage
+++ b/bitbake/bin/bbimage
@@ -4,18 +4,18 @@
4# 4#
5# Copyright (C) 2003 Chris Larson 5# Copyright (C) 2003 Chris Larson
6# 6#
7# This program is free software; you can redistribute it and/or modify it under 7# This program is free software; you can redistribute it and/or modify
8# the terms of the GNU General Public License as published by the Free Software 8# it under the terms of the GNU General Public License version 2 as
9# Foundation; either version 2 of the License, or (at your option) any later 9# published by the Free Software Foundation.
10# version. 10#
11# 11# This program is distributed in the hope that it will be useful,
12# This program is distributed in the hope that it will be useful, but WITHOUT 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14# GNU General Public License for more details.
15# 15#
16# You should have received a copy of the GNU General Public License along with 16# You should have received a copy of the GNU General Public License along
17# this program; if not, write to the Free Software Foundation, Inc., 59 Temple 17# with this program; if not, write to the Free Software Foundation, Inc.,
18# Place, Suite 330, Boston, MA 02111-1307 USA. 18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 19
20import sys, os 20import sys, os
21sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) 21sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 33e8933..001f229 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -9,55 +9,27 @@
9# Copyright (C) 2005 ROAD GmbH 9# Copyright (C) 2005 ROAD GmbH
10# Copyright (C) 2006 Richard Purdie 10# Copyright (C) 2006 Richard Purdie
11# 11#
12# This program is free software; you can redistribute it and/or modify it under 12# 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 13# 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 14# published by the Free Software Foundation.
15# version.
16# 15#
17# This program is distributed in the hope that it will be useful, but WITHOUT 16# This program is distributed in the hope that it will be useful,
18# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20# 20#
21# You should have received a copy of the GNU General Public License along with 21# 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 22# with this program; if not, write to the Free Software Foundation, Inc.,
23# Place, Suite 330, Boston, MA 02111-1307 USA. 23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 24
25import sys, os, getopt, glob, copy, os.path, re, time 25import sys, os, getopt, re, time, optparse
26sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) 26sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
27import bb 27import bb
28from bb import utils, data, parse, event, cache, providers, taskdata, runqueue 28from bb import cooker
29from sets import Set
30import itertools, optparse
31
32parsespin = itertools.cycle( r'|/-\\' )
33 29
34__version__ = "1.7.4" 30__version__ = "1.7.4"
35 31
36#============================================================================# 32#============================================================================#
37# BBStatistics
38#============================================================================#
39class BBStatistics:
40 """
41 Manage build statistics for one run
42 """
43 def __init__(self ):
44 self.attempt = 0
45 self.success = 0
46 self.fail = 0
47 self.deps = 0
48
49 def show( self ):
50 print "Build statistics:"
51 print " Attempted builds: %d" % self.attempt
52 if self.fail:
53 print " Failed builds: %d" % self.fail
54 if self.deps:
55 print " Dependencies not satisfied: %d" % self.deps
56 if self.fail or self.deps: return 1
57 else: return 0
58
59
60#============================================================================#
61# BBOptions 33# BBOptions
62#============================================================================# 34#============================================================================#
63class BBConfiguration( object ): 35class BBConfiguration( object ):
@@ -68,622 +40,6 @@ class BBConfiguration( object ):
68 for key, val in options.__dict__.items(): 40 for key, val in options.__dict__.items():
69 setattr( self, key, val ) 41 setattr( self, key, val )
70 42
71#============================================================================#
72# BBCooker
73#============================================================================#
74class BBCooker:
75 """
76 Manages one bitbake build run
77 """
78
79 Statistics = BBStatistics # make it visible from the shell
80
81 def __init__( self ):
82 self.build_cache_fail = []
83 self.build_cache = []
84 self.stats = BBStatistics()
85 self.status = None
86
87 self.cache = None
88 self.bb_cache = None
89
90 def tryBuildPackage(self, fn, item, task, the_data, build_depends):
91 """
92 Build one task of a package, optionally build following task depends
93 """
94 bb.event.fire(bb.event.PkgStarted(item, the_data))
95 try:
96 self.stats.attempt += 1
97 if self.configuration.force:
98 bb.data.setVarFlag('do_%s' % task, 'force', 1, the_data)
99 if not build_depends:
100 bb.data.setVarFlag('do_%s' % task, 'dontrundeps', 1, the_data)
101 if not self.configuration.dry_run:
102 bb.build.exec_task('do_%s' % task, the_data)
103 bb.event.fire(bb.event.PkgSucceeded(item, the_data))
104 self.build_cache.append(fn)
105 return True
106 except bb.build.FuncFailed:
107 self.stats.fail += 1
108 bb.msg.error(bb.msg.domain.Build, "task stack execution failed")
109 bb.event.fire(bb.event.PkgFailed(item, the_data))
110 self.build_cache_fail.append(fn)
111 raise
112 except bb.build.EventException, e:
113 self.stats.fail += 1
114 event = e.args[1]
115 bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % bb.event.getName(event))
116 bb.event.fire(bb.event.PkgFailed(item, the_data))
117 self.build_cache_fail.append(fn)
118 raise
119
120 def tryBuild( self, fn, build_depends):
121 """
122 Build a provider and its dependencies.
123 build_depends is a list of previous build dependencies (not runtime)
124 If build_depends is empty, we're dealing with a runtime depends
125 """
126
127 the_data = self.bb_cache.loadDataFull(fn, self.configuration.data)
128
129 item = self.status.pkg_fn[fn]
130
131 if bb.build.stamp_is_current('do_%s' % self.configuration.cmd, the_data) and not self.configuration.force:
132 self.build_cache.append(fn)
133 return True
134
135 return self.tryBuildPackage(fn, item, self.configuration.cmd, the_data, build_depends)
136
137 def showVersions( self ):
138 pkg_pn = self.status.pkg_pn
139 preferred_versions = {}
140 latest_versions = {}
141
142 # Sort by priority
143 for pn in pkg_pn.keys():
144 (last_ver,last_file,pref_ver,pref_file) = bb.providers.findBestProvider(pn, self.configuration.data, self.status)
145 preferred_versions[pn] = (pref_ver, pref_file)
146 latest_versions[pn] = (last_ver, last_file)
147
148 pkg_list = pkg_pn.keys()
149 pkg_list.sort()
150
151 for p in pkg_list:
152 pref = preferred_versions[p]
153 latest = latest_versions[p]
154
155 if pref != latest:
156 prefstr = pref[0][0] + "-" + pref[0][1]
157 else:
158 prefstr = ""
159
160 print "%-30s %20s %20s" % (p, latest[0][0] + "-" + latest[0][1],
161 prefstr)
162
163
164 def showEnvironment( self ):
165 """Show the outer or per-package environment"""
166 if self.configuration.buildfile:
167 self.cb = None
168 self.bb_cache = bb.cache.init(self)
169 try:
170 self.configuration.data = self.bb_cache.loadDataFull(self.configuration.buildfile, self.configuration.data)
171 except IOError, e:
172 bb.msg.fatal(bb.msg.domain.Parsing, "Unable to read %s: %s" % ( self.configuration.buildfile, e ))
173 except Exception, e:
174 bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
175 # emit variables and shell functions
176 try:
177 data.update_data( self.configuration.data )
178 data.emit_env(sys.__stdout__, self.configuration.data, True)
179 except Exception, e:
180 bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
181 # emit the metadata which isnt valid shell
182 data.expandKeys( self.configuration.data )
183 for e in self.configuration.data.keys():
184 if data.getVarFlag( e, 'python', self.configuration.data ):
185 sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, data.getVar(e, self.configuration.data, 1)))
186
187 def generateDotGraph( self, pkgs_to_build, ignore_deps ):
188 """
189 Generate a task dependency graph.
190
191 pkgs_to_build A list of packages that needs to be built
192 ignore_deps A list of names where processing of dependencies
193 should be stopped. e.g. dependencies that get
194 """
195
196 for dep in ignore_deps:
197 self.status.ignored_dependencies.add(dep)
198
199 localdata = data.createCopy(self.configuration.data)
200 bb.data.update_data(localdata)
201 bb.data.expandKeys(localdata)
202 taskdata = bb.taskdata.TaskData(self.configuration.abort)
203
204 runlist = []
205 try:
206 for k in pkgs_to_build:
207 taskdata.add_provider(localdata, self.status, k)
208 runlist.append([k, "do_%s" % self.configuration.cmd])
209 taskdata.add_unresolved(localdata, self.status)
210 except bb.providers.NoProvider:
211 sys.exit(1)
212 rq = bb.runqueue.RunQueue()
213 rq.prepare_runqueue(self.configuration.data, self.status, taskdata, runlist)
214
215 seen_fnids = []
216 depends_file = file('depends.dot', 'w' )
217 tdepends_file = file('task-depends.dot', 'w' )
218 print >> depends_file, "digraph depends {"
219 print >> tdepends_file, "digraph depends {"
220 rq.prio_map.reverse()
221 for task1 in range(len(rq.runq_fnid)):
222 task = rq.prio_map[task1]
223 taskname = rq.runq_task[task]
224 fnid = rq.runq_fnid[task]
225 fn = taskdata.fn_index[fnid]
226 pn = self.status.pkg_fn[fn]
227 version = self.bb_cache.getVar('PV', fn, True ) + '-' + self.bb_cache.getVar('PR', fn, True)
228 print >> tdepends_file, '"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn)
229 for dep in rq.runq_depends[task]:
230 depfn = taskdata.fn_index[rq.runq_fnid[dep]]
231 deppn = self.status.pkg_fn[depfn]
232 print >> tdepends_file, '"%s.%s" -> "%s.%s"' % (pn, rq.runq_task[task], deppn, rq.runq_task[dep])
233 if fnid not in seen_fnids:
234 seen_fnids.append(fnid)
235 packages = []
236 print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn)
237 for depend in self.status.deps[fn]:
238 print >> depends_file, '"%s" -> "%s"' % (pn, depend)
239 rdepends = self.status.rundeps[fn]
240 for package in rdepends:
241 for rdepend in rdepends[package]:
242 print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend)
243 packages.append(package)
244 rrecs = self.status.runrecs[fn]
245 for package in rrecs:
246 for rdepend in rrecs[package]:
247 print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend)
248 if not package in packages:
249 packages.append(package)
250 for package in packages:
251 if package != pn:
252 print >> depends_file, '"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn)
253 for depend in self.status.deps[fn]:
254 print >> depends_file, '"%s" -> "%s"' % (package, depend)
255 # Prints a flattened form of the above where subpackages of a package are merged into the main pn
256 #print >> depends_file, '"%s" [label="%s %s\\n%s\\n%s"]' % (pn, pn, taskname, version, fn)
257 #for rdep in taskdata.rdepids[fnid]:
258 # print >> depends_file, '"%s" -> "%s" [style=dashed]' % (pn, taskdata.run_names_index[rdep])
259 #for dep in taskdata.depids[fnid]:
260 # print >> depends_file, '"%s" -> "%s"' % (pn, taskdata.build_names_index[dep])
261 print >> depends_file, "}"
262 print >> tdepends_file, "}"
263 bb.msg.note(1, bb.msg.domain.Collection, "Dependencies saved to 'depends.dot'")
264 bb.msg.note(1, bb.msg.domain.Collection, "Task dependencies saved to 'task-depends.dot'")
265
266 def buildDepgraph( self ):
267 all_depends = self.status.all_depends
268 pn_provides = self.status.pn_provides
269
270 localdata = data.createCopy(self.configuration.data)
271 bb.data.update_data(localdata)
272 bb.data.expandKeys(localdata)
273
274 def calc_bbfile_priority(filename):
275 for (regex, pri) in self.status.bbfile_config_priorities:
276 if regex.match(filename):
277 return pri
278 return 0
279
280 # Handle PREFERRED_PROVIDERS
281 for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
282 (providee, provider) = p.split(':')
283 if providee in self.status.preferred and self.status.preferred[providee] != provider:
284 bb.msg.error(bb.msg.domain.Provider, "conflicting preferences for %s: both %s and %s specified" % (providee, provider, self.status.preferred[providee]))
285 self.status.preferred[providee] = provider
286
287 # Calculate priorities for each file
288 for p in self.status.pkg_fn.keys():
289 self.status.bbfile_priority[p] = calc_bbfile_priority(p)
290
291 def buildWorldTargetList(self):
292 """
293 Build package list for "bitbake world"
294 """
295 all_depends = self.status.all_depends
296 pn_provides = self.status.pn_provides
297 bb.msg.debug(1, bb.msg.domain.Parsing, "collating packages for \"world\"")
298 for f in self.status.possible_world:
299 terminal = True
300 pn = self.status.pkg_fn[f]
301
302 for p in pn_provides[pn]:
303 if p.startswith('virtual/'):
304 bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to %s provider starting with virtual/" % (f, p))
305 terminal = False
306 break
307 for pf in self.status.providers[p]:
308 if self.status.pkg_fn[pf] != pn:
309 bb.msg.debug(2, bb.msg.domain.Parsing, "World build skipping %s due to both us and %s providing %s" % (f, pf, p))
310 terminal = False
311 break
312 if terminal:
313 self.status.world_target.add(pn)
314
315 # drop reference count now
316 self.status.possible_world = None
317 self.status.all_depends = None
318
319 def myProgressCallback( self, x, y, f, from_cache ):
320 """Update any tty with the progress change"""
321 if os.isatty(sys.stdout.fileno()):
322 sys.stdout.write("\rNOTE: Handling BitBake files: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) )
323 sys.stdout.flush()
324 else:
325 if x == 1:
326 sys.stdout.write("Parsing .bb files, please wait...")
327 sys.stdout.flush()
328 if x == y:
329 sys.stdout.write("done.")
330 sys.stdout.flush()
331
332 def interactiveMode( self ):
333 """Drop off into a shell"""
334 try:
335 from bb import shell
336 except ImportError, details:
337 bb.msg.fatal(bb.msg.domain.Parsing, "Sorry, shell not available (%s)" % details )
338 else:
339 bb.data.update_data( self.configuration.data )
340 bb.data.expandKeys( self.configuration.data )
341 shell.start( self )
342 sys.exit( 0 )
343
344 def parseConfigurationFile( self, afile ):
345 try:
346 self.configuration.data = bb.parse.handle( afile, self.configuration.data )
347
348 # Add the handlers we inherited by INHERIT
349 # we need to do this manually as it is not guranteed
350 # we will pick up these classes... as we only INHERIT
351 # on .inc and .bb files but not on .conf
352 data = bb.data.createCopy( self.configuration.data )
353 inherits = ["base"] + (bb.data.getVar('INHERIT', data, True ) or "").split()
354 for inherit in inherits:
355 data = bb.parse.handle( os.path.join('classes', '%s.bbclass' % inherit ), data, True )
356
357 # FIXME: This assumes that we included at least one .inc file
358 for var in bb.data.keys(data):
359 if bb.data.getVarFlag(var, 'handler', data):
360 bb.event.register(var,bb.data.getVar(var, data))
361
362 except IOError:
363 bb.msg.fatal(bb.msg.domain.Parsing, "Unable to open %s" % afile )
364 except bb.parse.ParseError, details:
365 bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (afile, details) )
366
367 def handleCollections( self, collections ):
368 """Handle collections"""
369 if collections:
370 collection_list = collections.split()
371 for c in collection_list:
372 regex = bb.data.getVar("BBFILE_PATTERN_%s" % c, self.configuration.data, 1)
373 if regex == None:
374 bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s not defined" % c)
375 continue
376 priority = bb.data.getVar("BBFILE_PRIORITY_%s" % c, self.configuration.data, 1)
377 if priority == None:
378 bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PRIORITY_%s not defined" % c)
379 continue
380 try:
381 cre = re.compile(regex)
382 except re.error:
383 bb.msg.error(bb.msg.domain.Parsing, "BBFILE_PATTERN_%s \"%s\" is not a valid regular expression" % (c, regex))
384 continue
385 try:
386 pri = int(priority)
387 self.status.bbfile_config_priorities.append((cre, pri))
388 except ValueError:
389 bb.msg.error(bb.msg.domain.Parsing, "invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority))
390
391
392 def cook( self, configuration, args ):
393 """
394 We are building stuff here. We do the building
395 from here. By default we try to execute task
396 build.
397 """
398
399 self.configuration = configuration
400
401 if self.configuration.verbose:
402 bb.msg.set_verbose(True)
403
404 if self.configuration.debug:
405 bb.msg.set_debug_level(self.configuration.debug)
406 else:
407 bb.msg.set_debug_level(0)
408
409 if self.configuration.debug_domains:
410 bb.msg.set_debug_domains(self.configuration.debug_domains)
411
412 self.configuration.data = bb.data.init()
413
414 for f in self.configuration.file:
415 self.parseConfigurationFile( f )
416
417 self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
418
419 if not self.configuration.cmd:
420 self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data)
421
422 # For backwards compatibility - REMOVE ME
423 if not self.configuration.cmd:
424 self.configuration.cmd = "build"
425
426 #
427 # Special updated configuration we use for firing events
428 #
429 self.configuration.event_data = bb.data.createCopy(self.configuration.data)
430 bb.data.update_data(self.configuration.event_data)
431
432 if self.configuration.show_environment:
433 self.showEnvironment()
434 sys.exit( 0 )
435
436 # inject custom variables
437 if not bb.data.getVar("BUILDNAME", self.configuration.data):
438 bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), self.configuration.data)
439 bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S',time.gmtime()),self.configuration.data)
440
441 buildname = bb.data.getVar("BUILDNAME", self.configuration.data)
442
443 if self.configuration.interactive:
444 self.interactiveMode()
445
446 if self.configuration.buildfile is not None:
447 bf = os.path.abspath( self.configuration.buildfile )
448 try:
449 os.stat(bf)
450 except OSError:
451 (filelist, masked) = self.collect_bbfiles()
452 regexp = re.compile(self.configuration.buildfile)
453 matches = []
454 for f in filelist:
455 if regexp.search(f) and os.path.isfile(f):
456 bf = f
457 matches.append(f)
458 if len(matches) != 1:
459 bb.msg.error(bb.msg.domain.Parsing, "Unable to match %s (%s matches found):" % (self.configuration.buildfile, len(matches)))
460 for f in matches:
461 bb.msg.error(bb.msg.domain.Parsing, " %s" % f)
462 sys.exit(1)
463 bf = matches[0]
464
465 bbfile_data = bb.parse.handle(bf, self.configuration.data)
466
467 item = bb.data.getVar('PN', bbfile_data, 1)
468 try:
469 self.tryBuildPackage(bf, item, self.configuration.cmd, bbfile_data, True)
470 except bb.build.EventException:
471 bb.msg.error(bb.msg.domain.Build, "Build of '%s' failed" % item )
472
473 sys.exit( self.stats.show() )
474
475 # initialise the parsing status now we know we will need deps
476 self.status = bb.cache.CacheData()
477
478 ignore = bb.data.getVar("ASSUME_PROVIDED", self.configuration.data, 1) or ""
479 self.status.ignored_dependencies = Set( ignore.split() )
480
481 self.handleCollections( bb.data.getVar("BBFILE_COLLECTIONS", self.configuration.data, 1) )
482
483 pkgs_to_build = None
484 if args:
485 if not pkgs_to_build:
486 pkgs_to_build = []
487 pkgs_to_build.extend(args)
488 if not pkgs_to_build:
489 bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, 1)
490 if bbpkgs:
491 pkgs_to_build = bbpkgs.split()
492 if not pkgs_to_build and not self.configuration.show_versions \
493 and not self.configuration.interactive \
494 and not self.configuration.show_environment:
495 print "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help'"
496 print "for usage information."
497 sys.exit(0)
498
499 # Import Psyco if available and not disabled
500 if not self.configuration.disable_psyco:
501 try:
502 import psyco
503 except ImportError:
504 bb.msg.note(1, bb.msg.domain.Collection, "Psyco JIT Compiler (http://psyco.sf.net) not available. Install it to increase performance.")
505 else:
506 psyco.bind( self.parse_bbfiles )
507 else:
508 bb.msg.note(1, bb.msg.domain.Collection, "You have disabled Psyco. This decreases performance.")
509
510 try:
511 bb.msg.debug(1, bb.msg.domain.Collection, "collecting .bb files")
512 (filelist, masked) = self.collect_bbfiles()
513 self.parse_bbfiles(filelist, masked, self.myProgressCallback)
514 bb.msg.debug(1, bb.msg.domain.Collection, "parsing complete")
515 print
516 if self.configuration.parse_only:
517 bb.msg.note(1, bb.msg.domain.Collection, "Requested parsing .bb files only. Exiting.")
518 return
519
520
521 self.buildDepgraph()
522
523 if self.configuration.show_versions:
524 self.showVersions()
525 sys.exit( 0 )
526 if 'world' in pkgs_to_build:
527 self.buildWorldTargetList()
528 pkgs_to_build.remove('world')
529 for t in self.status.world_target:
530 pkgs_to_build.append(t)
531
532 if self.configuration.dot_graph:
533 self.generateDotGraph( pkgs_to_build, self.configuration.ignored_dot_deps )
534 sys.exit( 0 )
535
536 bb.event.fire(bb.event.BuildStarted(buildname, pkgs_to_build, self.configuration.event_data))
537
538 localdata = data.createCopy(self.configuration.data)
539 bb.data.update_data(localdata)
540 bb.data.expandKeys(localdata)
541
542 taskdata = bb.taskdata.TaskData(self.configuration.abort)
543
544 runlist = []
545 try:
546 for k in pkgs_to_build:
547 taskdata.add_provider(localdata, self.status, k)
548 runlist.append([k, "do_%s" % self.configuration.cmd])
549 taskdata.add_unresolved(localdata, self.status)
550 except bb.providers.NoProvider:
551 sys.exit(1)
552
553 rq = bb.runqueue.RunQueue()
554 rq.prepare_runqueue(self.configuration.data, self.status, taskdata, runlist)
555 try:
556 failures = rq.execute_runqueue(self, self.configuration.data, self.status, taskdata, runlist)
557 except runqueue.TaskFailure, fnids:
558 for fnid in fnids:
559 bb.msg.error(bb.msg.domain.Build, "'%s' failed" % taskdata.fn_index[fnid])
560 sys.exit(1)
561 bb.event.fire(bb.event.BuildCompleted(buildname, pkgs_to_build, self.configuration.event_data, failures))
562
563 sys.exit( self.stats.show() )
564
565 except KeyboardInterrupt:
566 bb.msg.note(1, bb.msg.domain.Collection, "KeyboardInterrupt - Build not completed.")
567 sys.exit(1)
568
569 def get_bbfiles( self, path = os.getcwd() ):
570 """Get list of default .bb files by reading out the current directory"""
571 contents = os.listdir(path)
572 bbfiles = []
573 for f in contents:
574 (root, ext) = os.path.splitext(f)
575 if ext == ".bb":
576 bbfiles.append(os.path.abspath(os.path.join(os.getcwd(),f)))
577 return bbfiles
578
579 def find_bbfiles( self, path ):
580 """Find all the .bb files in a directory (uses find)"""
581 findcmd = 'find ' + path + ' -name *.bb | grep -v SCCS/'
582 try:
583 finddata = os.popen(findcmd)
584 except OSError:
585 return []
586 return finddata.readlines()
587
588 def collect_bbfiles( self ):
589 """Collect all available .bb build files"""
590 parsed, cached, skipped, masked = 0, 0, 0, 0
591 self.bb_cache = bb.cache.init(self)
592
593 files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
594 data.setVar("BBFILES", " ".join(files), self.configuration.data)
595
596 if not len(files):
597 files = self.get_bbfiles()
598
599 if not len(files):
600 bb.msg.error(bb.msg.domain.Collection, "no files to build.")
601
602 newfiles = []
603 for f in files:
604 if os.path.isdir(f):
605 dirfiles = self.find_bbfiles(f)
606 if dirfiles:
607 newfiles += dirfiles
608 continue
609 newfiles += glob.glob(f) or [ f ]
610
611 bbmask = bb.data.getVar('BBMASK', self.configuration.data, 1)
612
613 if not bbmask:
614 return (newfiles, 0)
615
616 try:
617 bbmask_compiled = re.compile(bbmask)
618 except sre_constants.error:
619 bb.msg.fatal(bb.msg.domain.Collection, "BBMASK is not a valid regular expression.")
620
621 finalfiles = []
622 for i in xrange( len( newfiles ) ):
623 f = newfiles[i]
624 if bbmask and bbmask_compiled.search(f):
625 bb.msg.debug(1, bb.msg.domain.Collection, "skipping masked file %s" % f)
626 masked += 1
627 continue
628 finalfiles.append(f)
629
630 return (finalfiles, masked)
631
632 def parse_bbfiles(self, filelist, masked, progressCallback = None):
633 parsed, cached, skipped = 0, 0, 0
634 for i in xrange( len( filelist ) ):
635 f = filelist[i]
636
637 bb.msg.debug(1, bb.msg.domain.Collection, "parsing %s" % f)
638
639 # read a file's metadata
640 try:
641 fromCache, skip = self.bb_cache.loadData(f, self.configuration.data)
642 if skip:
643 skipped += 1
644 bb.msg.debug(2, bb.msg.domain.Collection, "skipping %s" % f)
645 self.bb_cache.skip(f)
646 continue
647 elif fromCache: cached += 1
648 else: parsed += 1
649 deps = None
650
651 # Disabled by RP as was no longer functional
652 # allow metadata files to add items to BBFILES
653 #data.update_data(self.pkgdata[f])
654 #addbbfiles = self.bb_cache.getVar('BBFILES', f, False) or None
655 #if addbbfiles:
656 # for aof in addbbfiles.split():
657 # if not files.count(aof):
658 # if not os.path.isabs(aof):
659 # aof = os.path.join(os.path.dirname(f),aof)
660 # files.append(aof)
661
662 self.bb_cache.handle_data(f, self.status)
663
664 # now inform the caller
665 if progressCallback is not None:
666 progressCallback( i + 1, len( filelist ), f, fromCache )
667
668 except IOError, e:
669 self.bb_cache.remove(f)
670 bb.msg.error(bb.msg.domain.Collection, "opening %s: %s" % (f, e))
671 pass
672 except KeyboardInterrupt:
673 self.bb_cache.sync()
674 raise
675 except Exception, e:
676 self.bb_cache.remove(f)
677 bb.msg.error(bb.msg.domain.Collection, "%s while parsing %s" % (e, f))
678 except:
679 self.bb_cache.remove(f)
680 raise
681
682 if progressCallback is not None:
683 print "\r" # need newline after Handling Bitbake files message
684 bb.msg.note(1, bb.msg.domain.Collection, "Parsing finished. %d cached, %d parsed, %d skipped, %d masked." % ( cached, parsed, skipped, masked ))
685
686 self.bb_cache.sync()
687 43
688#============================================================================# 44#============================================================================#
689# main 45# main
@@ -747,12 +103,13 @@ Default BBFILES are the .bb files in the current directory.""" )
747 action = "append", dest = "debug_domains", default = [] ) 103 action = "append", dest = "debug_domains", default = [] )
748 104
749 105
750 options, args = parser.parse_args( sys.argv ) 106 options, args = parser.parse_args(sys.argv)
751
752 cooker = BBCooker()
753 cooker.cook( BBConfiguration( options ), args[1:] )
754 107
108 configuration = BBConfiguration(options)
109 configuration.pkgs_to_build = []
110 configuration.pkgs_to_build.extend(args[1:])
755 111
112 bb.cooker.BBCooker().cook(configuration)
756 113
757if __name__ == "__main__": 114if __name__ == "__main__":
758 main() 115 main()
@@ -761,4 +118,6 @@ if __name__ == "__main__":
761 profile.run('main()', "profile.log") 118 profile.run('main()', "profile.log")
762 import pstats 119 import pstats
763 p = pstats.Stats('profile.log') 120 p = pstats.Stats('profile.log')
121 p.sort_stats('time')
764 p.print_stats() 122 p.print_stats()
123 p.print_callers()
diff --git a/bitbake/bin/bitdoc b/bitbake/bin/bitdoc
index e865e1b..3bcc9b3 100755
--- a/bitbake/bin/bitdoc
+++ b/bitbake/bin/bitdoc
@@ -4,26 +4,18 @@
4# 4#
5# Copyright (C) 2005 Holger Hans Peter Freyther 5# Copyright (C) 2005 Holger Hans Peter Freyther
6# 6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
7# 10#
8# Permission is hereby granted, free of charge, to any person obtaining a copy 11# This program is distributed in the hope that it will be useful,
9# of this software and associated documentation files (the "Software"), to deal 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# in the Software without restriction, including without limitation the rights 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14# GNU General Public License for more details.
12# copies of the Software, and to permit persons to whom the Software is
13# furnished to do so, subject to the following conditions:
14#
15# The above copyright notice and this permission notice shall be included in all
16# copies or substantial portions of the Software.
17#
18# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
21# SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
24# THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25#
26# 15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 19
28import optparse, os, sys 20import optparse, os, sys
29 21
diff --git a/bitbake/doc/COPYING.GPL b/bitbake/doc/COPYING.GPL
index d60c31a..d511905 100644
--- a/bitbake/doc/COPYING.GPL
+++ b/bitbake/doc/COPYING.GPL
@@ -1,8 +1,8 @@
1 GNU GENERAL PUBLIC LICENSE 1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991 2 Version 2, June 1991
3 3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies 6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed. 7 of this license document, but changing it is not allowed.
8 8
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software 15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to 16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by 17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to 18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too. 19your programs, too.
20 20
21 When we speak of free software, we are referring to freedom, not 21 When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
55 55
56 The precise terms and conditions for copying, distribution and 56 The precise terms and conditions for copying, distribution and
57modification follow. 57modification follow.
58 58
59 GNU GENERAL PUBLIC LICENSE 59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 61
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
110 License. (Exception: if the Program itself is interactive but 110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on 111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.) 112 the Program is not required to print an announcement.)
113 113
114These requirements apply to the modified work as a whole. If 114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program, 115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in 116and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as 168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not 169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code. 170compelled to copy the source along with the object code.
171 171
172 4. You may not copy, modify, sublicense, or distribute the Program 172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt 173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is 174otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
225 225
226This section is intended to make thoroughly clear what is believed to 226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License. 227be a consequence of the rest of this License.
228 228
229 8. If the distribution and/or use of the Program is restricted in 229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the 230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License 231original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES. 278POSSIBILITY OF SUCH DAMAGES.
279 279
280 END OF TERMS AND CONDITIONS 280 END OF TERMS AND CONDITIONS
281 281
282 How to Apply These Terms to Your New Programs 282 How to Apply These Terms to Your New Programs
283 283
284 If you develop a new program, and you want it to be of the greatest 284 If you develop a new program, and you want it to be of the greatest
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details. 304 GNU General Public License for more details.
305 305
306 You should have received a copy of the GNU General Public License 306 You should have received a copy of the GNU General Public License along
307 along with this program; if not, write to the Free Software 307 with this program; if not, write to the Free Software Foundation, Inc.,
308 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310 309
311Also add information on how to contact you by electronic and paper mail. 310Also add information on how to contact you by electronic and paper mail.
312 311
313If the program is interactive, make it output a short notice like this 312If the program is interactive, make it output a short notice like this
314when it starts in an interactive mode: 313when it starts in an interactive mode:
315 314
316 Gnomovision version 69, Copyright (C) year name of author 315 Gnomovision version 69, Copyright (C) year name of author
317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 This is free software, and you are welcome to redistribute it 317 This is free software, and you are welcome to redistribute it
319 under certain conditions; type `show c' for details. 318 under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
336This General Public License does not permit incorporating your program into 335This General Public License does not permit incorporating your program into
337proprietary programs. If your program is a subroutine library, you may 336proprietary programs. If your program is a subroutine library, you may
338consider it more useful to permit linking proprietary applications with the 337consider it more useful to permit linking proprietary applications with the
339library. If this is what you want to do, use the GNU Library General 338library. If this is what you want to do, use the GNU Lesser General
340Public License instead of this License. 339Public License instead of this License.
diff --git a/bitbake/doc/bitbake.1 b/bitbake/doc/bitbake.1
new file mode 100644
index 0000000..e6cbe7d
--- /dev/null
+++ b/bitbake/doc/bitbake.1
@@ -0,0 +1,117 @@
1.\" Hey, EMACS: -*- nroff -*-
2.\" First parameter, NAME, should be all caps
3.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4.\" other parameters are allowed: see man(7), man(1)
5.TH BITBAKE 1 "November 19, 2006"
6.\" Please adjust this date whenever revising the manpage.
7.\"
8.\" Some roff macros, for reference:
9.\" .nh disable hyphenation
10.\" .hy enable hyphenation
11.\" .ad l left justify
12.\" .ad b justify to both left and right margins
13.\" .nf disable filling
14.\" .fi enable filling
15.\" .br insert line break
16.\" .sp <n> insert n+1 empty lines
17.\" for manpage-specific macros, see man(7)
18.SH NAME
19BitBake \- simple tool for the execution of tasks
20.SH SYNOPSIS
21.B bitbake
22.RI [ options ] " packagenames"
23.br
24.SH DESCRIPTION
25This manual page documents briefly the
26.B bitbake
27command.
28.PP
29.\" TeX users may be more comfortable with the \fB<whatever>\fP and
30.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
31.\" respectively.
32\fBbitbake\fP is a program that executes the specified task (default is 'build')
33for a given set of BitBake files.
34.br
35It expects that BBFILES is defined, which is a space seperated list of files to
36be executed. BBFILES does support wildcards.
37.br
38Default BBFILES are the .bb files in the current directory.
39.SH OPTIONS
40This program follow the usual GNU command line syntax, with long
41options starting with two dashes (`-').
42.TP
43.B \-h, \-\-help
44Show summary of options.
45.TP
46.B \-\-version
47Show version of program.
48.TP
49.B \-bBUILDFILE, \-\-buildfile=BUILDFILE
50execute the task against this .bb file, rather than a package from BBFILES.
51.TP
52.B \-k, \-\-continue
53continue as much as possible after an error. While the target that failed, and
54those that depend on it, cannot be remade, the other dependencies of these
55targets can be processed all the same.
56.TP
57.B \-f, \-\-force
58force run of specified cmd, regardless of stamp status
59.TP
60.B \-i, \-\-interactive
61drop into the interactive mode also called the BitBake shell.
62.TP
63.B \-cCMD, \-\-cmd=CMD
64Specify task to execute. Note that this only executes the specified task for
65the providee and the packages it depends on, i.e. 'compile' does not implicitly
66call stage for the dependencies (IOW: use only if you know what you are doing).
67Depending on the base.bbclass a listtaks tasks is defined and will show
68available tasks.
69.TP
70.B \-rFILE, \-\-read=FILE
71read the specified file before bitbake.conf
72.TP
73.B \-v, \-\-verbose
74output more chit-chat to the terminal
75.TP
76.B \-D, \-\-debug
77Increase the debug level. You can specify this more than once.
78.TP
79.B \-n, \-\-dry-run
80don't execute, just go through the motions
81.TP
82.B \-p, \-\-parse-only
83quit after parsing the BB files (developers only)
84.TP
85.B \-d, \-\-disable-psyco
86disable using the psyco just-in-time compiler (not recommended)
87.TP
88.B \-s, \-\-show-versions
89show current and preferred versions of all packages
90.TP
91.B \-e, \-\-environment
92show the global or per-package environment (this is what used to be bbread)
93.TP
94.B \-g, \-\-graphviz
95emit the dependency trees of the specified packages in the dot syntax
96.TP
97.B \-IIGNORED\_DOT\_DEPS, \-\-ignore-deps=IGNORED_DOT_DEPS
98Stop processing at the given list of dependencies when generating dependency
99graphs. This can help to make the graph more appealing
100.\"
101.\" Next option is only in BitBake 1.7.x (trunk)
102.\"
103.\".TP
104.\".B \-lDEBUG_DOMAINS, \-\-log-domains=DEBUG_DOMAINS
105.\"Show debug logging for the specified logging domains
106
107.SH AUTHORS
108BitBake was written by
109Phil Blundell,
110Holger Freyther,
111Chris Larson,
112Mickey Lauer,
113Richard Purdie,
114Holger Schurig
115.PP
116This manual page was written by Marcin Juszkiewicz <marcin@hrw.one.pl>
117for the Debian project (but may be used by others).
diff --git a/bitbake/lib/bb/COW.py b/bitbake/lib/bb/COW.py
index 826d435..e5063d6 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#
4This 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#
6Please 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
11from inspect import getmro 26from inspect import getmro
12 27
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 61eb5f3..a11af84 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#
5BitBake Build System Python Library 4# BitBake Build System Python Library
6 5#
7Copyright (C) 2003 Holger Schurig 6# Copyright (C) 2003 Holger Schurig
8Copyright (C) 2003, 2004 Chris Larson 7# Copyright (C) 2003, 2004 Chris Larson
9 8#
10Based on Gentoo's portage.py. 9# Based on Gentoo's portage.py.
11 10#
12This 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
13the 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
14Foundation; either version 2 of the License, or (at your option) any later 13# published by the Free Software Foundation.
15version. 14#
16 15# This program is distributed in the hope that it will be useful,
17This program is distributed in the hope that it will be useful, but WITHOUT 16# but WITHOUT ANY WARRANTY; without even the implied warranty of
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 18# GNU General Public License for more details.
20 19#
21You 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
22this 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.,
23Place, 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 942bdc1..bf6b612 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#
5BitBake 'Build' implementation 4# BitBake 'Build' implementation
6 5#
7Core code for function execution and task handling in the 6# Core code for function execution and task handling in the
8BitBake build tools. 7# BitBake build tools.
9 8#
10Copyright (C) 2003, 2004 Chris Larson 9# Copyright (C) 2003, 2004 Chris Larson
11 10#
12Based on Gentoo's portage.py. 11# Based on Gentoo's portage.py.
13 12#
14This 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
15the 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
16Foundation; either version 2 of the License, or (at your option) any later 15# published by the Free Software Foundation.
17version. 16#
18 17# This program is distributed in the hope that it will be useful,
19This program is distributed in the hope that it will be useful, but WITHOUT 18# but WITHOUT ANY WARRANTY; without even the implied warranty of
20ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 20# GNU General Public License for more details.
22 21#
23You 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.,
25Based 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
28from bb import data, fetch, event, mkdirhier, utils 28from bb import data, fetch, event, mkdirhier, utils
29import bb, os 29import 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
296def stamp_is_current_cache(dataCache, file_name, task, checkdeps = 1): 299def 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) 312def 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
334def stamp_is_current(task, d, checkdeps = 1): 321def 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 364def stamp_internal(task, d, file_name):
374def 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
378def 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
382def 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
392def 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
392def add_task(task, deps, d): 399def 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 05c4251..934d230 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#
5BitBake 'Event' implementation 4# BitBake 'Event' implementation
6 5#
7Caching 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
18This program is free software; you can redistribute it and/or modify it under
19the terms of the GNU General Public License as published by the Free Software
20Foundation; either version 2 of the License, or (at your option) any later
21version.
22
23This program is distributed in the hope that it will be useful, but WITHOUT
24ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
26
27You should have received a copy of the GNU General Public License along with
28this program; if not, write to the Free Software Foundation, Inc., 59 Temple
29Place, Suite 330, Boston, MA 02111-1307 USA.
30
31"""
32 30
33import os, re 31import os, re
34import bb.data 32import bb.data
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
new file mode 100644
index 0000000..8a9c588
--- /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
25import sys, os, getopt, glob, copy, os.path, re, time
26import bb
27from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
28from sets import Set
29import itertools
30
31parsespin = itertools.cycle( r'|/-\\' )
32
33#============================================================================#
34# BBStatistics
35#============================================================================#
36class 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#============================================================================#
59class 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 print
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 9f7e4be..14f1d89 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
19This is a treade-off between speed and memory again but 18This is a treade-off between speed and memory again but
20the speed is more critical here. 19the speed is more critical here.
21
22Copyright (C) 2003, 2004 Chris Larson
23Copyright (C) 2005 Holger Hans Peter Freyther
24
25This program is free software; you can redistribute it and/or modify it under
26the terms of the GNU General Public License as published by the Free Software
27Foundation; either version 2 of the License, or (at your option) any later
28version.
29
30This program is distributed in the hope that it will be useful, but WITHOUT
31ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
32FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
33
34You should have received a copy of the GNU General Public License along with
35this program; if not, write to the Free Software Foundation, Inc., 59 Temple
36Place, Suite 330, Boston, MA 02111-1307 USA.
37
38Based 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
41import sys, os, re, time, types 40import sys, os, re, time, types
42if sys.argv[0][-5:] == "pydoc": 41if 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 d63fdde..ef1e9dd 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -6,28 +6,28 @@ BitBake Smart Dictionary Implementation
6Functions for interacting with the data structure used by the 6Functions for interacting with the data structure used by the
7BitBake build tools. 7BitBake build tools.
8 8
9Copyright (C) 2003, 2004 Chris Larson
10Copyright (C) 2004, 2005 Seb Frankengul
11Copyright (C) 2005, 2006 Holger Hans Peter Freyther
12Copyright (C) 2005 Uli Luckas
13Copyright (C) 2005 ROAD GmbH
14
15This program is free software; you can redistribute it and/or modify it under
16the terms of the GNU General Public License as published by the Free Software
17Foundation; either version 2 of the License, or (at your option) any later
18version.
19
20This program is distributed in the hope that it will be useful, but WITHOUT
21ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
23
24You should have received a copy of the GNU General Public License along with
25this program; if not, write to the Free Software Foundation, Inc., 59 Temple
26Place, Suite 330, Boston, MA 02111-1307 USA.
27
28Based 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
31import copy, os, re, sys, time, types 31import copy, os, re, sys, time, types
32import bb 32import bb
33from bb import utils, methodpool 33from bb import utils, methodpool
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index b1d1217..f1da98f 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
7Classes and functions for manipulating 'events' in the 6Classes and functions for manipulating 'events' in the
8BitBake build tools. 7BitBake build tools.
9
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, 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
26import os, re 25import os, re
27import bb.data 26import bb.data
28import bb.utils 27import bb.utils
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 3521ece..31a4adc 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
7Classes for obtaining upstream sources for the 6Classes for obtaining upstream sources for the
8BitBake build tools. 7BitBake build tools.
9
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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
28import os, re 27import os, re
29import bb 28import bb
30from bb import data 29from bb import data
diff --git a/bitbake/lib/bb/fetch/cvs.py b/bitbake/lib/bb/fetch/cvs.py
index 3bdac17..bd33171 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
7Classes for obtaining upstream sources for the 6Classes for obtaining upstream sources for the
8BitBake build tools. 7BitBake build tools.
9 8
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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
28import os, re 29import os, re
29import bb 30import bb
30from bb import data 31from 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 bb517c9..c0cd27d 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"""
5BitBake 'Fetch' git implementation 4BitBake 'Fetch' git implementation
6 5
7Copyright (C) 2005 Richard Purdie
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free Software
11Foundation; either version 2 of the License, or (at your option) any later
12version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License along with
19this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20Place, 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
23import os, re 23import os, re
24import bb 24import bb
25from bb import data 25from bb import data
diff --git a/bitbake/lib/bb/fetch/local.py b/bitbake/lib/bb/fetch/local.py
index 5224976..9be8f1c 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
7Classes for obtaining upstream sources for the 6Classes for obtaining upstream sources for the
8BitBake build tools. 7BitBake build tools.
9 8
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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
28import os, re 28import os, re
29import bb 29import bb
30from bb import data 30from bb import data
diff --git a/bitbake/lib/bb/fetch/perforce.py b/bitbake/lib/bb/fetch/perforce.py
index 88acf69..125eb99 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
7Classes for obtaining upstream sources for the 6Classes for obtaining upstream sources for the
8BitBake build tools. 7BitBake build tools.
9 8
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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
28import os, re 28import os, re
29import bb 29import bb
30from bb import data 30from bb import data
diff --git a/bitbake/lib/bb/fetch/ssh.py b/bitbake/lib/bb/fetch/ssh.py
index e5f69e3..81a9892 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
14Copyright (C) 2006 OpenedHand Ltd. 13'''
15
16Based 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
24This program is free software; you can redistribute it and/or modify it under
25the terms of the GNU General Public License as published by the Free Software
26Foundation; either version 2 of the License, or (at your option) any later
27version.
28 14
29This program is distributed in the hope that it will be useful, but WITHOUT 15# Copyright (C) 2006 OpenedHand Ltd.
30ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16#
31FOR 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
33You should have received a copy of the GNU General Public License along with
34this program; if not, write to the Free Software Foundation, Inc., 59 Temple
35Place, Suite 330, Boston, MA 02111-1307 USA.
36'''
37import re, os 39import re, os
38import bb 40import bb
39from bb import data 41from bb import data
diff --git a/bitbake/lib/bb/fetch/svk.py b/bitbake/lib/bb/fetch/svk.py
index 29270ab..d863ccb 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
7This implementation is for svk. It is based on the svn implementation 6This implementation is for svk. It is based on the svn implementation
8 7
9Copyright (C) 2006 Holger Hans Peter Freyther
10
11GPL and MIT licensed
12
13
14
15Classes for obtaining upstream sources for the
16BitBake build tools.
17
18Copyright (C) 2003, 2004 Chris Larson
19
20This program is free software; you can redistribute it and/or modify it under
21the terms of the GNU General Public License as published by the Free Software
22Foundation; either version 2 of the License, or (at your option) any later
23version.
24
25This program is distributed in the hope that it will be useful, but WITHOUT
26ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
27FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
28
29You should have received a copy of the GNU General Public License along with
30this program; if not, write to the Free Software Foundation, Inc., 59 Temple
31Place, Suite 330, Boston, MA 02111-1307 USA.
32
33Based 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
36import os, re 28import os, re
37import bb 29import bb
38from bb import data 30from bb import data
diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py
index ebd5beb..21be141 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
7This implementation is for svn. It is based on the cvs implementation. 6This implementation is for svn. It is based on the cvs implementation.
8 7
9Copyright (C) 2004 Marcin Juszkiewicz
10
11Classes for obtaining upstream sources for the
12BitBake build tools.
13
14Copyright (C) 2003, 2004 Chris Larson
15
16This program is free software; you can redistribute it and/or modify it under
17the terms of the GNU General Public License as published by the Free Software
18Foundation; either version 2 of the License, or (at your option) any later
19version.
20
21This program is distributed in the hope that it will be useful, but WITHOUT
22ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
24
25You should have received a copy of the GNU General Public License along with
26this program; if not, write to the Free Software Foundation, Inc., 59 Temple
27Place, Suite 330, Boston, MA 02111-1307 USA.
28
29Based 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
32import os, re 31import os, re
33import sys 32import sys
34import bb 33import bb
diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py
index 9c9c167..2d590ad 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
7Classes for obtaining upstream sources for the 6Classes for obtaining upstream sources for the
8BitBake build tools. 7BitBake build tools.
9 8
10Copyright (C) 2003, 2004 Chris Larson
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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
28import os, re 28import os, re
29import bb 29import bb
30from bb import data 30from bb import data
diff --git a/bitbake/lib/bb/manifest.py b/bitbake/lib/bb/manifest.py
index 30bb454..4e4b7d9 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
19import os, sys 19import os, sys
20import bb, bb.data 20import bb, bb.data
diff --git a/bitbake/lib/bb/methodpool.py b/bitbake/lib/bb/methodpool.py
index f0565ce..f43c4a0 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 473851c..bd77297 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
7Message handling infrastructure for bitbake 6Message handling infrastructure for bitbake
8 7
9# Copyright (C) 2006 Richard Purdie
10
11This program is free software; you can redistribute it and/or modify it under
12the terms of the GNU General Public License as published by the Free Software
13Foundation; either version 2 of the License, or (at your option) any later
14version.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License along with
21this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22Place, 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
26import sys, os, re, bb 25import sys, os, re, bb
27from bb import utils 26from bb import utils
28 27
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py
index 70fdba0..3c9ba8e 100644
--- a/bitbake/lib/bb/parse/__init__.py
+++ b/bitbake/lib/bb/parse/__init__.py
@@ -3,24 +3,26 @@ BitBake Parsers
3 3
4File parsers for the BitBake build tools. 4File parsers for the BitBake build tools.
5 5
6Copyright (C) 2003, 2004 Chris Larson 6"""
7Copyright (C) 2003, 2004 Phil Blundell
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free Software
11Foundation; either version 2 of the License, or (at your option) any later
12version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 7
18You should have received a copy of the GNU General Public License along with
19this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20Place, Suite 330, Boston, MA 02111-1307 USA.
21 8
22Based 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 42b0369..2c39316 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
24import re, bb, os, sys, time 28import re, bb, os, sys, time
25import bb.fetch, bb.build, bb.utils 29import 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 6c0a8cc..1ae6730 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
24import re, bb.data, os, sys 27import re, bb.data, os, sys
25from bb.parse import ParseError 28from 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 6a2ce40..9e0e00a 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
7File parsers for the BitBake build tools. 7File parsers for the BitBake build tools.
8 8
9Copyright (C) 2003, 2004 Chris Larson
10Copyright (C) 2003, 2004 Phil Blundell
11
12This program is free software; you can redistribute it and/or modify it under
13the terms of the GNU General Public License as published by the Free Software
14Foundation; either version 2 of the License, or (at your option) any later
15version.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA.
24
25Based 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 3cb7cc1..fdd6cd1 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
25import os, re 24import os, re
26from bb import data, utils 25from bb import data, utils
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 4da543f..2ef2670 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -5,20 +5,23 @@
5BitBake 'RunQueue' implementation 5BitBake 'RunQueue' implementation
6 6
7Handles preparation and execution of a queue of tasks 7Handles preparation and execution of a queue of tasks
8
9Copyright (C) 2006 Richard Purdie
10
11This program is free software; you can redistribute it and/or modify it under
12the terms of the GNU General Public License version 2 as published by the Free
13Software Foundation
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License along with
20""" 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
22from bb import msg, data, fetch, event, mkdirhier, utils 25from bb import msg, data, fetch, event, mkdirhier, utils
23from sets import Set 26from sets import Set
24import bb, os, sys 27import 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