From c30eddb243e7e65f67f656e62848a033cf6f2e5c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 30 Sep 2008 15:08:33 +0000 Subject: Add bitbake-dev to allow ease of testing and development of bitbake trunk git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5337 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake-dev/AUTHORS | 10 + bitbake-dev/COPYING | 339 +++++++ bitbake-dev/ChangeLog | 276 ++++++ bitbake-dev/bin/bbimage | 160 +++ bitbake-dev/bin/bitbake | 204 ++++ bitbake-dev/bin/bitdoc | 532 ++++++++++ bitbake-dev/lib/bb/COW.py | 320 ++++++ bitbake-dev/lib/bb/__init__.py | 1133 +++++++++++++++++++++ bitbake-dev/lib/bb/build.py | 377 +++++++ bitbake-dev/lib/bb/cache.py | 465 +++++++++ bitbake-dev/lib/bb/command.py | 211 ++++ bitbake-dev/lib/bb/cooker.py | 941 ++++++++++++++++++ bitbake-dev/lib/bb/daemonize.py | 189 ++++ bitbake-dev/lib/bb/data.py | 570 +++++++++++ bitbake-dev/lib/bb/data_smart.py | 292 ++++++ bitbake-dev/lib/bb/event.py | 302 ++++++ bitbake-dev/lib/bb/fetch/__init__.py | 556 +++++++++++ bitbake-dev/lib/bb/fetch/bzr.py | 154 +++ bitbake-dev/lib/bb/fetch/cvs.py | 178 ++++ bitbake-dev/lib/bb/fetch/git.py | 142 +++ bitbake-dev/lib/bb/fetch/hg.py | 141 +++ bitbake-dev/lib/bb/fetch/local.py | 72 ++ bitbake-dev/lib/bb/fetch/perforce.py | 213 ++++ bitbake-dev/lib/bb/fetch/ssh.py | 120 +++ bitbake-dev/lib/bb/fetch/svk.py | 109 ++ bitbake-dev/lib/bb/fetch/svn.py | 204 ++++ bitbake-dev/lib/bb/fetch/wget.py | 105 ++ bitbake-dev/lib/bb/manifest.py | 144 +++ bitbake-dev/lib/bb/methodpool.py | 84 ++ bitbake-dev/lib/bb/msg.py | 125 +++ bitbake-dev/lib/bb/parse/__init__.py | 80 ++ bitbake-dev/lib/bb/parse/parse_py/BBHandler.py | 416 ++++++++ bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py | 228 +++++ bitbake-dev/lib/bb/parse/parse_py/__init__.py | 33 + bitbake-dev/lib/bb/persist_data.py | 110 ++ bitbake-dev/lib/bb/providers.py | 303 ++++++ bitbake-dev/lib/bb/runqueue.py | 1157 ++++++++++++++++++++++ bitbake-dev/lib/bb/shell.py | 827 ++++++++++++++++ bitbake-dev/lib/bb/taskdata.py | 594 +++++++++++ bitbake-dev/lib/bb/ui/__init__.py | 18 + bitbake-dev/lib/bb/ui/depexplorer.py | 271 +++++ bitbake-dev/lib/bb/ui/knotty.py | 157 +++ bitbake-dev/lib/bb/ui/ncurses.py | 333 +++++++ bitbake-dev/lib/bb/ui/uievent.py | 127 +++ bitbake-dev/lib/bb/ui/uihelper.py | 49 + bitbake-dev/lib/bb/utils.py | 270 +++++ bitbake-dev/lib/bb/xmlrpcserver.py | 157 +++ 47 files changed, 13798 insertions(+) create mode 100644 bitbake-dev/AUTHORS create mode 100644 bitbake-dev/COPYING create mode 100644 bitbake-dev/ChangeLog create mode 100755 bitbake-dev/bin/bbimage create mode 100755 bitbake-dev/bin/bitbake create mode 100755 bitbake-dev/bin/bitdoc create mode 100644 bitbake-dev/lib/bb/COW.py create mode 100644 bitbake-dev/lib/bb/__init__.py create mode 100644 bitbake-dev/lib/bb/build.py create mode 100644 bitbake-dev/lib/bb/cache.py create mode 100644 bitbake-dev/lib/bb/command.py create mode 100644 bitbake-dev/lib/bb/cooker.py create mode 100644 bitbake-dev/lib/bb/daemonize.py create mode 100644 bitbake-dev/lib/bb/data.py create mode 100644 bitbake-dev/lib/bb/data_smart.py create mode 100644 bitbake-dev/lib/bb/event.py create mode 100644 bitbake-dev/lib/bb/fetch/__init__.py create mode 100644 bitbake-dev/lib/bb/fetch/bzr.py create mode 100644 bitbake-dev/lib/bb/fetch/cvs.py create mode 100644 bitbake-dev/lib/bb/fetch/git.py create mode 100644 bitbake-dev/lib/bb/fetch/hg.py create mode 100644 bitbake-dev/lib/bb/fetch/local.py create mode 100644 bitbake-dev/lib/bb/fetch/perforce.py create mode 100644 bitbake-dev/lib/bb/fetch/ssh.py create mode 100644 bitbake-dev/lib/bb/fetch/svk.py create mode 100644 bitbake-dev/lib/bb/fetch/svn.py create mode 100644 bitbake-dev/lib/bb/fetch/wget.py create mode 100644 bitbake-dev/lib/bb/manifest.py create mode 100644 bitbake-dev/lib/bb/methodpool.py create mode 100644 bitbake-dev/lib/bb/msg.py create mode 100644 bitbake-dev/lib/bb/parse/__init__.py create mode 100644 bitbake-dev/lib/bb/parse/parse_py/BBHandler.py create mode 100644 bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py create mode 100644 bitbake-dev/lib/bb/parse/parse_py/__init__.py create mode 100644 bitbake-dev/lib/bb/persist_data.py create mode 100644 bitbake-dev/lib/bb/providers.py create mode 100644 bitbake-dev/lib/bb/runqueue.py create mode 100644 bitbake-dev/lib/bb/shell.py create mode 100644 bitbake-dev/lib/bb/taskdata.py create mode 100644 bitbake-dev/lib/bb/ui/__init__.py create mode 100644 bitbake-dev/lib/bb/ui/depexplorer.py create mode 100644 bitbake-dev/lib/bb/ui/knotty.py create mode 100644 bitbake-dev/lib/bb/ui/ncurses.py create mode 100644 bitbake-dev/lib/bb/ui/uievent.py create mode 100644 bitbake-dev/lib/bb/ui/uihelper.py create mode 100644 bitbake-dev/lib/bb/utils.py create mode 100644 bitbake-dev/lib/bb/xmlrpcserver.py (limited to 'bitbake-dev') diff --git a/bitbake-dev/AUTHORS b/bitbake-dev/AUTHORS new file mode 100644 index 0000000000..97d44687d3 --- /dev/null +++ b/bitbake-dev/AUTHORS @@ -0,0 +1,10 @@ +Tim Ansell +Phil Blundell +Seb Frankengul +Holger Freyther +Marcin Juszkiewicz +Chris Larson +Ulrich Luckas +Mickey Lauer +Richard Purdie +Holger Schurig diff --git a/bitbake-dev/COPYING b/bitbake-dev/COPYING new file mode 100644 index 0000000000..d511905c16 --- /dev/null +++ b/bitbake-dev/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/bitbake-dev/ChangeLog b/bitbake-dev/ChangeLog new file mode 100644 index 0000000000..1ee7fd363f --- /dev/null +++ b/bitbake-dev/ChangeLog @@ -0,0 +1,276 @@ +Changes in Bitbake 1.9.x: + - Add PE (Package Epoch) support from Philipp Zabel (pH5) + - Treat python functions the same as shell functions for logging + - Use TMPDIR/anonfunc as a __anonfunc temp directory (T) + - Catch truncated cache file errors + - Allow operations other than assignment on flag variables + - Add code to handle inter-task dependencies + - Fix cache errors when generation dotGraphs + - Make sure __inherit_cache is updated before calling include() (from Michael Krelin) + - Fix bug when target was in ASSUME_PROVIDED (#2236) + - Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062) + - Fix invalid regexp in BBMASK error handling (missing import) (#1124) + - Promote certain warnings from debug to note 2 level + - Update manual + - Correctly redirect stdin when forking + - If parsing errors are found, exit, too many users miss the errors + - Remove supriours PREFERRED_PROVIDER warnings + - svn fetcher: Add _buildsvncommand function + - Improve certain error messages + - Rewrite svn fetcher to make adding extra operations easier + as part of future SRCDATE="now" fixes + (requires new FETCHCMD_svn definition in bitbake.conf) + - Change SVNDIR layout to be more unique (fixes #2644 and #2624) + - Add ConfigParsed Event after configuration parsing is complete + - Add SRCREV support for svn fetcher + - data.emit_var() - only call getVar if we need the variable + - Stop generating the A variable (seems to be legacy code) + - Make sure intertask depends get processed correcting in recursive depends + - Add pn-PN to overrides when evaluating PREFERRED_VERSION + - Improve the progress indicator by skipping tasks that have + already run before starting the build rather than during it + - Add profiling option (-P) + - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache + - Add SRCREV_FORMAT support + - Fix local fetcher's localpath return values + - Apply OVERRIDES before performing immediate expansions + - Allow the -b -e option combination to take regular expressions + - Fix handling of variables with expansion in the name using _append/_prepend + e.g. RRECOMMENDS_${PN}_append_xyz = "abc" + - Add plain message function to bb.msg + - Sort the list of providers before processing so dependency problems are + reproducible rather than effectively random + - Fix/improve bitbake -s output + - Add locking for fetchers so only one tries to fetch a given file at a given time + - Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains + - Expand data in addtasks + - Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...." + error message. + - Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction) + - Sort digraph output to make builds more reproducible + - Split expandKeys into two for loops to benefit from the expand_cache (12% speedup) + - runqueue.py: Fix idepends handling to avoid dependency errors + - Clear the terminal TOSTOP flag if set (and warn the user) + - Fix regression from r653 and make SRCDATE/CVSDATE work for packages again + - Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530) + - Warn about malformed PREFERRED_PROVIDERS (#1072) + - Add support for BB_NICE_LEVEL option (#1627) + - Psyco is used only on x86 as there is no support for other architectures. + - Sort initial providers list by default preference (#1145, #2024) + - Improve provider sorting so prefered versions have preference over latest versions (#768) + - Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359) + - Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed + - Handle paths in svn fetcher module parameter + - Support the syntax "export VARIABLE" + - Add bzr fetcher + - Add support for cleaning directories before a task in the form: + do_taskname[cleandirs] = "dir" + - bzr fetcher tweaks from Robert Schuster (#2913) + - Add mercurial (hg) fetcher from Robert Schuster (#2913) + - Don't add duplicates to BBPATH + - Fix preferred_version return values (providers.py) + - Fix 'depends' flag splitting + - Fix unexport handling (#3135) + - Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting) + - Allow multiple options for deptask flag + - Use git-fetch instead of git-pull removing any need for merges when + fetching (we don't care about the index). Fixes fetch errors. + - Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches + faster at the expense of not creating mirror tarballs. + - SRCREV handling updates, improvements and fixes from Poky + - Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky + - Add support for task selfstamp and lockfiles flags + - Disable task number acceleration since it can allow the tasks to run + out of sequence + - Improve runqueue code comments + - Add task scheduler abstraction and some example schedulers + - Improve circular dependency chain debugging code and user feedback + - Don't give a stacktrace for invalid tasks, have a user friendly message (#3431) + - Add support for "-e target" (#3432) + - Fix shell showdata command (#3259) + - Fix shell data updating problems (#1880) + - Properly raise errors for invalid source URI protocols + - Change the wget fetcher failure handling to avoid lockfile problems + - Add support for branches in git fetcher (Otavio Salvador, Michael Lauer) + - Make taskdata and runqueue errors more user friendly + - Add norecurse and fullpath options to cvs fetcher + - Fix exit code for build failures in --continue mode + - Fix git branch tags fetching + - Change parseConfigurationFile so it works on real data, not a copy + - Handle 'base' inherit and all other INHERITs from parseConfigurationFile + instead of BBHandler + - Fix getVarFlags bug in data_smart + - Optmise cache handling by more quickly detecting an invalid cache, only + saving the cache when its changed, moving the cache validity check into + the parsing loop and factoring some getVar calls outside a for loop + - Cooker: Remove a debug message from the parsing loop to lower overhead + - Convert build.py exec_task to use getVarFlags + - Update shell to use cooker.buildFile + - Add StampUpdate event + - Convert -b option to use taskdata/runqueue + - Remove digraph and switch to new stamp checking code. exec_task no longer + honours dependencies + - Make fetcher timestamp updating non-fatal when permissions don't allow + updates + - Add BB_SCHEDULER variable/option ("completion" or "speed") controlling + the way bitbake schedules tasks + - Add BB_STAMP_POLICY variable/option ("perfile" or "full") controlling + how extensively stamps are looked at for validity + - When handling build target failures make sure idepends are checked and + failed where needed. Fixes --continue mode crashes. + - Fix -f (force) in conjunction with -b + - Fix problems with recrdeptask handling where some idepends weren't handled + correctly. + - Handle exit codes correctly (from pH5) + - Work around refs/HEAD issues with git over http (#3410) + - Add proxy support to the CVS fetcher (from Cyril Chemparathy) + - Improve runfetchcmd so errors are seen and various GIT variables are exported + - Add ability to fetchers to check URL validity without downloading + - Improve runtime PREFERRED_PROVIDERS warning message + - Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when + checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist" + - No longer weight providers on the basis of a package being "already staged". This + leads to builds being non-deterministic. + - Flush stdout/stderr before forking to fix duplicate console output + - Make sure recrdeps tasks include all inter-task dependencies of a given fn + - Add bb.runqueue.check_stamp_fn() for use by packaged-staging + - Add PERSISTENT_DIR to store the PersistData in a persistent + directory != the cache dir. + - Add md5 and sha256 checksum generation functions to utils.py + +Changes in Bitbake 1.8.0: + - Release 1.7.x as a stable series + +Changes in BitBake 1.7.x: + - Major updates of the dependency handling and execution + of tasks. Code from bin/bitbake replaced with runqueue.py + and taskdata.py + - New task execution code supports multithreading with a simplistic + threading algorithm controlled by BB_NUMBER_THREADS + - Change of the SVN Fetcher to keep the checkout around + courtsey of Paul Sokolovsky (#1367) + - PATH fix to bbimage (#1108) + - Allow debug domains to be specified on the commandline (-l) + - Allow 'interactive' tasks + - Logging message improvements + - Drop now uneeded BUILD_ALL_DEPS variable + - Add support for wildcards to -b option + - Major overhaul of the fetchers making a large amount of code common + including mirroring code + - Fetchers now touch md5 stamps upon access (to show activity) + - Fix -f force option when used without -b (long standing bug) + - Add expand_cache to data_cache.py, caching expanded data (speedup) + - Allow version field in DEPENDS (ignored for now) + - Add abort flag support to the shell + - Make inherit fail if the class doesn't exist (#1478) + - Fix data.emit_env() to expand keynames as well as values + - Add ssh fetcher + - Add perforce fetcher + - Make PREFERRED_PROVIDER_foobar defaults to foobar if available + - Share the parser's mtime_cache, reducing the number of stat syscalls + - Compile all anonfuncs at once! + *** Anonfuncs must now use common spacing format *** + - Memorise the list of handlers in __BBHANDLERS and tasks in __BBTASKS + This removes 2 million function calls resulting in a 5-10% speedup + - Add manpage + - Update generateDotGraph to use taskData/runQueue improving accuracy + and also adding a task dependency graph + - Fix/standardise on GPLv2 licence + - Move most functionality from bin/bitbake to cooker.py and split into + separate funcitons + - CVS fetcher: Added support for non-default port + - Add BBINCLUDELOGS_LINES, the number of lines to read from any logfile + - Drop shebangs from lib/bb scripts + +Changes in Bitbake 1.6.0: + - Better msg handling + - COW dict implementation from Tim Ansell (mithro) leading + to better performance + - Speed up of -s + +Changes in Bitbake 1.4.4: + - SRCDATE now handling courtsey Justin Patrin + - #1017 fix to work with rm_work + +Changes in BitBake 1.4.2: + - Send logs to oe.pastebin.com instead of pastebin.com + fixes #856 + - Copy the internal bitbake data before building the + dependency graph. This fixes nano not having a + virtual/libc dependency + - Allow multiple TARBALL_STASH entries + - Cache, check if the directory exists before changing + into it + - git speedup cloning by not doing a checkout + - allow to have spaces in filenames (.conf, .bb, .bbclass) + +Changes in BitBake 1.4.0: + - Fix to check both RDEPENDS and RDEPENDS_${PN} + - Fix a RDEPENDS parsing bug in utils:explode_deps() + - Update git fetcher behaviour to match git changes + - ASSUME_PROVIDED allowed to include runtime packages + - git fetcher cleanup and efficency improvements + - Change the format of the cache + - Update usermanual to document the Fetchers + - Major changes to caching with a new strategy + giving a major performance increase when reparsing + with few data changes + +Changes in BitBake 1.3.3: + - Create a new Fetcher module to ease the + development of new Fetchers. + Issue #438 fixed by rpurdie@openedhand.com + - Make the Subversion fetcher honor the SRC Date + (CVSDATE). + Issue #555 fixed by chris@openedhand.com + - Expand PREFERRED_PROVIDER properly + Issue #436 fixed by rprudie@openedhand.com + - Typo fix for Issue #531 by Philipp Zabel for the + BitBake Shell + - Introduce a new special variable SRCDATE as + a generic naming to replace CVSDATE. + - Introduce a new keyword 'required'. In contrast + to 'include' parsing will fail if a to be included + file can not be found. + - Remove hardcoding of the STAMP directory. Patch + courtsey pHilipp Zabel + - Track the RDEPENDS of each package (rpurdie@openedhand.com) + - Introduce BUILD_ALL_DEPS to build all RDEPENDS. E.g + this is used by the OpenEmbedded Meta Packages. + (rpurdie@openedhand.com). + +Changes in BitBake 1.3.2: + - reintegration of make.py into BitBake + - bbread is gone, use bitbake -e + - lots of shell updates and bugfixes + - Introduction of the .= and =. operator + - Sort variables, keys and groups in bitdoc + - Fix regression in the handling of BBCOLLECTIONS + - Update the bitbake usermanual + +Changes in BitBake 1.3.0: + - add bitbake interactive shell (bitbake -i) + - refactor bitbake utility in OO style + - kill default arguments in methods in the bb.data module + - kill default arguments in methods in the bb.fetch module + - the http/https/ftp fetcher will fail if the to be + downloaded file was not found in DL_DIR (this is needed + to avoid unpacking the sourceforge mirror page) + - Switch to a cow like data instance for persistent and non + persisting mode (called data_smart.py) + - Changed the callback of bb.make.collect_bbfiles to carry + additional parameters + - Drastically reduced the amount of needed RAM by not holding + each data instance in memory when using a cache/persistent + storage + +Changes in BitBake 1.2.1: + The 1.2.1 release is meant as a intermediate release to lay the + ground for more radical changes. The most notable changes are: + + - Do not hardcode {}, use bb.data.init() instead if you want to + get a instance of a data class + - bb.data.init() is a factory and the old bb.data methods are delegates + - Do not use deepcopy use bb.data.createCopy() instead. + - Removed default arguments in bb.fetch + diff --git a/bitbake-dev/bin/bbimage b/bitbake-dev/bin/bbimage new file mode 100755 index 0000000000..96b7dca323 --- /dev/null +++ b/bitbake-dev/bin/bbimage @@ -0,0 +1,160 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright (C) 2003 Chris Larson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import sys, os +sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) +import bb +from bb import * + +__version__ = 1.1 +type = "jffs2" +cfg_bb = data.init() +cfg_oespawn = data.init() + +bb.msg.set_debug_level(0) + +def usage(): + print "Usage: bbimage [options ...]" + print "Creates an image for a target device from a root filesystem," + print "obeying configuration parameters from the BitBake" + print "configuration files, thereby easing handling of deviceisms." + print "" + print " %s\t\t%s" % ("-r [arg], --root [arg]", "root directory (default=${IMAGE_ROOTFS})") + print " %s\t\t%s" % ("-t [arg], --type [arg]", "image type (jffs2[default], cramfs)") + print " %s\t\t%s" % ("-n [arg], --name [arg]", "image name (override IMAGE_NAME variable)") + print " %s\t\t%s" % ("-v, --version", "output version information and exit") + sys.exit(0) + +def version(): + print "BitBake Build Tool Core version %s" % bb.__version__ + print "BBImage version %s" % __version__ + +def emit_bb(d, base_d = {}): + for v in d.keys(): + if d[v] != base_d[v]: + data.emit_var(v, d) + +def getopthash(l): + h = {} + for (opt, val) in l: + h[opt] = val + return h + +import getopt +try: + (opts, args) = getopt.getopt(sys.argv[1:], 'vr:t:e:n:', [ 'version', 'root=', 'type=', 'bbfile=', 'name=' ]) +except getopt.GetoptError: + usage() + +# handle opts +opthash = getopthash(opts) + +if '--version' in opthash or '-v' in opthash: + version() + sys.exit(0) + +try: + cfg_bb = parse.handle(os.path.join('conf', 'bitbake.conf'), cfg_bb) +except IOError: + fatal("Unable to open bitbake.conf") + +# sanity check +if cfg_bb is None: + fatal("Unable to open/parse %s" % os.path.join('conf', 'bitbake.conf')) + usage(1) + +# Handle any INHERITs and inherit the base class +inherits = ["base"] + (bb.data.getVar('INHERIT', cfg_bb, True ) or "").split() +for inherit in inherits: + cfg_bb = bb.parse.handle(os.path.join('classes', '%s.bbclass' % inherit), cfg_bb, True ) + +rootfs = None +extra_files = [] + +if '--root' in opthash: + rootfs = opthash['--root'] +if '-r' in opthash: + rootfs = opthash['-r'] + +if '--type' in opthash: + type = opthash['--type'] +if '-t' in opthash: + type = opthash['-t'] + +if '--bbfile' in opthash: + extra_files.append(opthash['--bbfile']) +if '-e' in opthash: + extra_files.append(opthash['-e']) + +for f in extra_files: + try: + cfg_bb = parse.handle(f, cfg_bb) + except IOError: + print "unable to open %s" % f + +if not rootfs: + rootfs = data.getVar('IMAGE_ROOTFS', cfg_bb, 1) + +if not rootfs: + bb.fatal("IMAGE_ROOTFS not defined") + +data.setVar('IMAGE_ROOTFS', rootfs, cfg_bb) + +from copy import copy, deepcopy +localdata = data.createCopy(cfg_bb) + +overrides = data.getVar('OVERRIDES', localdata) +if not overrides: + bb.fatal("OVERRIDES not defined.") +data.setVar('OVERRIDES', '%s:%s' % (overrides, type), localdata) +data.update_data(localdata) +data.setVar('OVERRIDES', overrides, localdata) + +if '-n' in opthash: + data.setVar('IMAGE_NAME', opthash['-n'], localdata) +if '--name' in opthash: + data.setVar('IMAGE_NAME', opthash['--name'], localdata) + +topdir = data.getVar('TOPDIR', localdata, 1) or os.getcwd() + +cmd = data.getVar('IMAGE_CMD', localdata, 1) +if not cmd: + bb.fatal("IMAGE_CMD not defined") + +outdir = data.getVar('DEPLOY_DIR_IMAGE', localdata, 1) +if not outdir: + bb.fatal('DEPLOY_DIR_IMAGE not defined') +mkdirhier(outdir) + +#depends = data.getVar('IMAGE_DEPENDS', localdata, 1) or "" +#if depends: +# bb.note("Spawning bbmake to satisfy dependencies: %s" % depends) +# ret = os.system('bbmake %s' % depends) +# if ret != 0: +# bb.error("executing bbmake to satisfy dependencies") + +bb.note("Executing %s" % cmd) +data.setVar('image_cmd', cmd, localdata) +data.setVarFlag('image_cmd', 'func', 1, localdata) +try: + bb.build.exec_func('image_cmd', localdata) +except bb.build.FuncFailed: + sys.exit(1) +#ret = os.system(cmd) +#sys.exit(ret) diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake new file mode 100755 index 0000000000..067cc274f9 --- /dev/null +++ b/bitbake-dev/bin/bitbake @@ -0,0 +1,204 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright (C) 2003, 2004 Chris Larson +# Copyright (C) 2003, 2004 Phil Blundell +# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer +# Copyright (C) 2005 Holger Hans Peter Freyther +# Copyright (C) 2005 ROAD GmbH +# Copyright (C) 2006 Richard Purdie +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import sys, os, getopt, re, time, optparse, xmlrpclib +sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) +import bb +from bb import cooker +from bb import daemonize +from bb import ui +from bb.ui import uievent + +__version__ = "1.9.0" + +#============================================================================# +# BBOptions +#============================================================================# +class BBConfiguration( object ): + """ + Manages build options and configurations for one run + """ + def __init__( self, options ): + for key, val in options.__dict__.items(): + setattr( self, key, val ) + + +#============================================================================# +# main +#============================================================================# + +def main(): + return_value = 0 + pythonver = sys.version_info + if pythonver[0] < 2 or (pythonver[0] == 2 and pythonver[1] < 5): + print "Sorry, bitbake needs python 2.5 or later." + sys.exit(1) + + parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % ( bb.__version__, __version__ ), + usage = """%prog [options] [package ...] + +Executes the specified task (default is 'build') for a given set of BitBake files. +It expects that BBFILES is defined, which is a space separated list of files to +be executed. BBFILES does support wildcards. +Default BBFILES are the .bb files in the current directory.""" ) + + parser.add_option( "-b", "--buildfile", help = "execute the task against this .bb file, rather than a package from BBFILES.", + action = "store", dest = "buildfile", default = None ) + + parser.add_option( "-k", "--continue", help = "continue as much as possible after an error. While the target that failed, and those that depend on it, cannot be remade, the other dependencies of these targets can be processed all the same.", + action = "store_false", dest = "abort", default = True ) + + parser.add_option( "-f", "--force", help = "force run of specified cmd, regardless of stamp status", + action = "store_true", dest = "force", default = False ) + + parser.add_option( "-i", "--interactive", help = "drop into the interactive mode also called the BitBake shell.", + action = "store_true", dest = "interactive", default = False ) + + parser.add_option( "-c", "--cmd", help = "Specify task to execute. Note that this only executes the specified task for the providee and the packages it depends on, i.e. 'compile' does not implicitly call stage for the dependencies (IOW: use only if you know what you are doing). Depending on the base.bbclass a listtasks tasks is defined and will show available tasks", + action = "store", dest = "cmd" ) + + parser.add_option( "-r", "--read", help = "read the specified file before bitbake.conf", + action = "append", dest = "file", default = [] ) + + parser.add_option( "-v", "--verbose", help = "output more chit-chat to the terminal", + action = "store_true", dest = "verbose", default = False ) + + parser.add_option( "-D", "--debug", help = "Increase the debug level. You can specify this more than once.", + action = "count", dest="debug", default = 0) + + parser.add_option( "-n", "--dry-run", help = "don't execute, just go through the motions", + action = "store_true", dest = "dry_run", default = False ) + + parser.add_option( "-p", "--parse-only", help = "quit after parsing the BB files (developers only)", + action = "store_true", dest = "parse_only", default = False ) + + parser.add_option( "-d", "--disable-psyco", help = "disable using the psyco just-in-time compiler (not recommended)", + action = "store_true", dest = "disable_psyco", default = False ) + + parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages", + action = "store_true", dest = "show_versions", default = False ) + + parser.add_option( "-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)", + action = "store_true", dest = "show_environment", default = False ) + + parser.add_option( "-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax", + action = "store_true", dest = "dot_graph", default = False ) + + parser.add_option( "-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""", + action = "append", dest = "extra_assume_provided", default = [] ) + + parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""", + action = "append", dest = "debug_domains", default = [] ) + + parser.add_option( "-P", "--profile", help = "profile the command and print a report", + action = "store_true", dest = "profile", default = False ) + + parser.add_option( "-u", "--ui", help = "userinterface to use", + action = "store", dest = "ui") + + options, args = parser.parse_args(sys.argv) + + configuration = BBConfiguration(options) + configuration.pkgs_to_build = [] + configuration.pkgs_to_build.extend(args[1:]) + + + # Work out which UI(s) to use + curseUI = False + depexplorerUI = False + if configuration.ui: + if configuration.ui == "ncurses": + curseUI = True + elif configuration.ui == "knotty" or configuration.ui == "tty" or configuration.ui == "file": + curseUI = False + elif configuration.ui == "depexp": + depexplorerUI = True + else: + print "FATAL: Invalid user interface '%s' specified.\nValid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." % configuration.ui + sys.exit(1) + + + cooker = bb.cooker.BBCooker(configuration) + host = cooker.server.host + port = cooker.server.port + + # Save a logfile for cooker somewhere + t = bb.data.getVar('TMPDIR', cooker.configuration.data, True) + if not t: + bb.msg.fatal(bb.msg.domain.Build, "TMPDIR not set") + t = os.path.join(t, "cooker") + bb.mkdirhier(t) + cooker_logfile = "%s/log.cooker.%s" % (t, str(os.getpid())) + + daemonize.createDaemon(cooker.serve, cooker_logfile) + del cooker + + # Setup a connection to the server (cooker) + server = xmlrpclib.Server("http://%s:%s" % (host, port), allow_none=True) + # Setup an event receiving queue + eventHandler = uievent.BBUIEventQueue(server) + + # Launch the UI + try: + # Disable UIs that need a terminal + if not os.isatty(sys.stdout.fileno()): + curseUI = False + + if curseUI: + try: + import curses + except ImportError, details: + curseUI = False + + if curseUI: + from bb.ui import ncurses + ncurses.init(server, eventHandler) + elif depexplorerUI: + from bb.ui import depexplorer + depexplorer.init(server, eventHandler) + else: + from bb.ui import knotty + return_value = knotty.init(server, eventHandler) + + finally: + # Don't wait for server indefinitely + import socket + socket.setdefaulttimeout(2) + try: + eventHandler.system_quit() + except: + pass + try: + server.terminateServer() + except: + pass + return return_value + +if __name__ == "__main__": + print """WARNING, WARNING, WARNING +This is a Bitbake from the Unstable/Development 1.9 Branch. This software is a work in progress and should only be used by Bitbake developers/testers""" + + ret = main() + sys.exit(ret) + diff --git a/bitbake-dev/bin/bitdoc b/bitbake-dev/bin/bitdoc new file mode 100755 index 0000000000..3bcc9b344b --- /dev/null +++ b/bitbake-dev/bin/bitdoc @@ -0,0 +1,532 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright (C) 2005 Holger Hans Peter Freyther +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import optparse, os, sys + +# bitbake +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) +import bb +import bb.parse +from string import split, join + +__version__ = "0.0.2" + +class HTMLFormatter: + """ + Simple class to help to generate some sort of HTML files. It is + quite inferior solution compared to docbook, gtkdoc, doxygen but it + should work for now. + We've a global introduction site (index.html) and then one site for + the list of keys (alphabetical sorted) and one for the list of groups, + one site for each key with links to the relations and groups. + + index.html + all_keys.html + all_groups.html + groupNAME.html + keyNAME.html + """ + + def replace(self, text, *pairs): + """ + From pydoc... almost identical at least + """ + while pairs: + (a,b) = pairs[0] + text = join(split(text, a), b) + pairs = pairs[1:] + return text + def escape(self, text): + """ + Escape string to be conform HTML + """ + return self.replace(text, + ('&', '&'), + ('<', '<' ), + ('>', '>' ) ) + def createNavigator(self): + """ + Create the navgiator + """ + return """ + + + + + +""" + + def relatedKeys(self, item): + """ + Create HTML to link to foreign keys + """ + + if len(item.related()) == 0: + return "" + + txt = "

See also:
" + txts = [] + for it in item.related(): + txts.append("""%(it)s""" % vars() ) + + return txt + ",".join(txts) + + def groups(self,item): + """ + Create HTML to link to related groups + """ + + if len(item.groups()) == 0: + return "" + + + txt = "

See also:
" + txts = [] + for group in item.groups(): + txts.append( """%s """ % (group,group) ) + + return txt + ",".join(txts) + + + def createKeySite(self,item): + """ + Create a site for a key. It contains the header/navigator, a heading, + the description, links to related keys and to the groups. + """ + + return """ +Key %s + + +%s +

%s

+ +
+

Synopsis

+

+%s +

+
+ +
+

Related Keys

+

+%s +

+
+ +
+

Groups

+

+%s +

+
+ + + +""" % (item.name(), self.createNavigator(), item.name(), + self.escape(item.description()), self.relatedKeys(item), self.groups(item)) + + def createGroupsSite(self, doc): + """ + Create the Group Overview site + """ + + groups = "" + sorted_groups = doc.groups() + sorted_groups.sort() + for group in sorted_groups: + groups += """%s
""" % (group, group) + + return """ +Group overview + + +%s +

Available Groups

+%s + +""" % (self.createNavigator(), groups) + + def createIndex(self): + """ + Create the index file + """ + + return """ +Bitbake Documentation + + +%s +

Documentation Entrance

+All available groups
+All available keys
+ +""" % self.createNavigator() + + def createKeysSite(self, doc): + """ + Create Overview of all avilable keys + """ + keys = "" + sorted_keys = doc.doc_keys() + sorted_keys.sort() + for key in sorted_keys: + keys += """%s
""" % (key, key) + + return """ +Key overview + + +%s +

Available Keys

+%s + +""" % (self.createNavigator(), keys) + + def createGroupSite(self, gr, items, _description = None): + """ + Create a site for a group: + Group the name of the group, items contain the name of the keys + inside this group + """ + groups = "" + description = "" + + # create a section with the group descriptions + if _description: + description += "

" % gr + description += _description + + items.sort(lambda x,y:cmp(x.name(),y.name())) + for group in items: + groups += """%s
""" % (group.name(), group.name()) + + return """ +Group %s + + +%s +%s +
+

Keys in Group %s

+
+%s
+
+
+ +""" % (gr, self.createNavigator(), description, gr, groups) + + + + def createCSS(self): + """ + Create the CSS file + """ + return """.synopsis, .classsynopsis +{ + background: #eeeeee; + border: solid 1px #aaaaaa; + padding: 0.5em; +} +.programlisting +{ + background: #eeeeff; + border: solid 1px #aaaaff; + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} +table.navigation +{ + background: #ffeeee; + border: solid 1px #ffaaaa; + margin-top: 0.5em; + margin-bottom: 0.5em; +} +.navigation a +{ + color: #770000; +} +.navigation a:visited +{ + color: #550000; +} +.navigation .title +{ + font-size: 200%; +} +div.refnamediv +{ + margin-top: 2em; +} +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} +a +{ + text-decoration: none; +} +a:hover +{ + text-decoration: underline; + color: #FF0000; +} +""" + + + +class DocumentationItem: + """ + A class to hold information about a configuration + item. It contains the key name, description, a list of related names, + and the group this item is contained in. + """ + + def __init__(self): + self._groups = [] + self._related = [] + self._name = "" + self._desc = "" + + def groups(self): + return self._groups + + def name(self): + return self._name + + def description(self): + return self._desc + + def related(self): + return self._related + + def setName(self, name): + self._name = name + + def setDescription(self, desc): + self._desc = desc + + def addGroup(self, group): + self._groups.append(group) + + def addRelation(self,relation): + self._related.append(relation) + + def sort(self): + self._related.sort() + self._groups.sort() + + +class Documentation: + """ + Holds the documentation... with mappings from key to items... + """ + + def __init__(self): + self.__keys = {} + self.__groups = {} + + def insert_doc_item(self, item): + """ + Insert the Doc Item into the internal list + of representation + """ + item.sort() + self.__keys[item.name()] = item + + for group in item.groups(): + if not group in self.__groups: + self.__groups[group] = [] + self.__groups[group].append(item) + self.__groups[group].sort() + + + def doc_item(self, key): + """ + Return the DocumentationInstance describing the key + """ + try: + return self.__keys[key] + except KeyError: + return None + + def doc_keys(self): + """ + Return the documented KEYS (names) + """ + return self.__keys.keys() + + def groups(self): + """ + Return the names of available groups + """ + return self.__groups.keys() + + def group_content(self,group_name): + """ + Return a list of keys/names that are in a specefic + group or the empty list + """ + try: + return self.__groups[group_name] + except KeyError: + return [] + + +def parse_cmdline(args): + """ + Parse the CMD line and return the result as a n-tuple + """ + + parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__,__version__)) + usage = """%prog [options] + +Create a set of html pages (documentation) for a bitbake.conf.... +""" + + # Add the needed options + parser.add_option( "-c", "--config", help = "Use the specified configuration file as source", + action = "store", dest = "config", default = os.path.join("conf", "documentation.conf") ) + + parser.add_option( "-o", "--output", help = "Output directory for html files", + action = "store", dest = "output", default = "html/" ) + + parser.add_option( "-D", "--debug", help = "Increase the debug level", + action = "count", dest = "debug", default = 0 ) + + parser.add_option( "-v","--verbose", help = "output more chit-char to the terminal", + action = "store_true", dest = "verbose", default = False ) + + options, args = parser.parse_args( sys.argv ) + + if options.debug: + bb.msg.s