aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
AgeCommit message (Collapse)Author
2013-01-28bitbake: command: Fix getCmdLineAction bugsdenzilRichard Purdie
Executing "bitbake" doesn't get a sane message since the None return value wasn't being handled correctly. Also fix msg -> cmd_action['msg'] as otherwise an invalid variable is accessed which then crashes the server due to the previous bug. (Bitbake rev: c6211291ae07410832031a5274690437cc2b09a6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28bitbake: command: Add missing import tracebackRichard Purdie
Without this, if an exception occurs the server will silently crash with no feedback to the user about why (since traceback isn't imported). (Bitbake rev: e637a635bf7b5a9a2e9dc20afc18aceec98d578f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28bitbake: command: add error to return of runCommandChristopher Larson
Currently, command.py can return an error message from runCommand, due to being unable to run the command, yet few of our UIs (just hob) can handle it today. This can result in seeing a TypeError with traceback in certain rare circumstances. To resolve this, we need a clean way to get errors back from runCommand, without having to isinstance() the return value. This implements such a thing by making runCommand also return an error (or None if no error occurred). As runCommand now has a method of returning errors, we can also alter the getCmdLineAction bits such that the returned value is just the action, not an additional message. If a sync command wants to return an error, it raises CommandError(message), and the message will be passed to the caller appropriately. Example Usage: result, error = server.runCommand(...) if error: log.error('Unable to run command: %s' % error) return 1 (Bitbake rev: 717831b8315cb3904d9b590e633000bc897e8fb6) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-13ConfHandler.py: Add a hook for config parsingRichard Purdie
To make the UI settings take effect, we need to hook at the end of each config file parsing and set UI specific values. (Bitbake rev: f54e733c7863110896f43900d9e4e791602f9d65) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-29command.py: Move triggerEvent to command async classDongxiao Xu
The parameters in triggerEvent function is an event object, and it may cost some time to pass this object through pipe, causing the pipe's poll() function timeout. Change it to async mode. (Bitbake rev: 3b5909ebc86a12dedfb30e5446aa81eb58921760) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01command.py: remove the resolve parameter in generateTargetsTreeDongxiao Xu
Remove the "resolve" parameter since the original resolve=False option is no longer be used. (Bitbake rev: dadce609149cfb09ecdc53bfe1f416a3f57a5033) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23command.py: add resolve option for generateTargetsTree APIDongxiao Xu
Currently we have generateTargetsTree API, which is used to get dependency information. However in that tree, there will be "virtual/xxx" in depends fields. Therefore we add the resolve option to replace it with its real providers. Besides, for packages that provided by multiple recipes, we will find their preverred provider. (Bitbake rev: 28501612efdfc6ee47576cc90deb6e897883e7f5) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23command.py: Add a new API triggerEvent()Dongxiao Xu
This functions enables the client to request triggering specific event from bitbake server. (Bitbake rev: 45da6d709a69697158fae92e1c0c0a6ac8f30831) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23command.py: add new API to get the cpu count on the serverShane Wang
Add a new API in command.py to get the cpu count in order to set the appropriate default BB_NUMBER_THREADS and PARALLEL_MAKE variables. (Bitbake rev: 335047b2e440e65713e88fabb24b47a9c82f939b) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-10bitbake: Add BBHandledException exception classRichard Purdie
We have a problem knowing when to show the user debug information and when not to since the code has already shown the user suitable information about why a failure is occurring. This patch adds a bb.BBHandledException exception class which can be used to identify those exceptions which don't need further explanation to the user. This patch uses this class for the bb.providers exceptions and ensures the command handling code correctly filters the exceptions meaning that "bitbake invalid" now shows an simple error message and not a python traceback. [YOCTO #1141 partial] (Bitbake rev: eac9249b40ae1e3aa21e016010c862664e59a8d4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06command.py: add parseConfigurationFiles APIDongxiao Xu
The parseConfigurationFiles API calls the related function in cooker.py to parse config files. (Bitbake rev: 96c307b9874131ad8c7d9caea6f6dfbd09aab9d4) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06cooker: remove command import in cooker.pyDongxiao Xu
There is no direct use of command in cooker.py, and it is using bb.command instead. Remove command in the import list. This fixes a problem of embedded import between command.py and cooker.py. (Bitbake rev: c353316b2efcc7a893d6b4aa9a9647d51a6f69e3) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06command.py: add initCooker APIDongxiao Xu
initCooker is to set the cooker to the initial state with nothing parsed. (Bitbake rev: 8ee9c6cc47938604268242d90bd3007218f9a36e) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06command.py: Modify needcache value for certain functionsDongxiao Xu
for findConfigFiels() and findFilesMatchingInDir() functions, they don't need to parse all the bb files, thus setting the needcache value to be False. (Bitbake rev: 3ef73dee8b08ccfd15a4901cce315a99b22e71d7) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-05Remove the async_cmds and sync_cmds from command.pyRobert Yang
In bitbake/lib/bb/command.py::Command::__init__, we have the following lines: for attr in CommandsSync.__dict__: command = attr[:].lower() method = getattr(CommandsSync, attr) sync_cmds[command] = (method) for attr in CommandsAsync.__dict__: command = attr[:].lower() method = getattr(CommandsAsync, attr) async_cmds[command] = (method) The sync_cmds and async_cmds are defined as global dictionaries, but it seems that we've never used them (I did a "grep -r async_cmds bitbake/", , there is no result except the ones that I have removed), and I can't find the history of it from "git log -p", I guess that they have been replaced by the self.cmds_sync and self.cmds_async. [YOCTO #1791] (Bitbake rev: 24e99460800856035bb54a84c7aa33b3517436e9) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27bitbake: Update users of getVar/setVar to use the data store functions directlyRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12bb/command|cooker: refactor the reparseFiles logicJoshua Lock
Turn the reparseFiles logic into a command to reset the cooker's state machine and a noop which triggers a cache rebuild. The resetCooker command resets the cookers state machine such that a cache update will be triggered by any async command which requires the cache. The reparseFiles command remains as a noop async command that has the needcache property set to True so that when called it ensures the cache is built. Patch from Richard with the addition of removing the force parameter from the updateCache method. CC: Richard Purdie <richard.purdie@linuxfoundation.org> (Bitbake rev: a98f698fe9f38310024013e58475e6d1447ee154) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26command|cooker: Add reparseFiles commandJoshua Lock
Add command reparseFiles to reparse bb files in a running cooker instance. Fixes [YOCTO #1249] (Bitbake rev: de035ad99feb7644f99ad54804bf9f98cc776877) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01cooker|command|event: add new command findFilesMatchingInDirJoshua Lock
This command can be used to search each BBPATH for files in the passed directory which have a filename matching the supplied pattern. This is implemented for use from the GUI (to determine the available PACKAGE_CLASSES) but has been written so as to be generically useful and reusable. (Bitbake rev: 2a599812a57cb0b964880a6a2b7548423497ea92) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01command|cooker|event: add findConfigFilePath commandJoshua Lock
This takes the name of a .conf file and returns the full path to it (Bitbake rev: 22c8600b885faf841795b872d82f68dfb644a26e) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01command|cooker: allow generating targets tree for specified pkgsJoshua Lock
Modify the generateTargetsTree command to allow a list of packages to be supplied by the caller, in this case we will only generate a target tree for user requested targets rather than building a tree for the world list. (Bitbake rev: d4e4f2ecae96e074b2ab3bb9882037af2e385fdd) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08bitbake: Cleanup bitbake server init process to be clearer to followRichard Purdie
Create a standard format server class instance with method calls for each step in the server setup. There should be enough hooks for each of the different server types. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-24bitbake: implement command to find configuration files for a config variableJoshua Lock
Some configuration variables (MACHINE, MACHINE-SDK and DISTRO) set which confguration files bitbake should use. The added command , findConfigFiles, enables a UI to query which files are suitable values for a specified parameter. Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24bitbake: implement command to get all possible targets and their dependenciesJoshua Lock
Add a new command generateTargetsTree() which returns a dependency tree of possible targets (tasks and recipes) as well as their dependency information. Optional parameter 'klass' also ensures any recipes which inherit the specified class path (i.e. 'classes/image.bbclass') are included in the model Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-04Rename command events, adjust compareRevisionsChris Larson
- Moved the logic for comparing revisions from cooker into command - Removed 'Cooker' from the event names - Renamed the 'ExitCode' event into CommandExit, and changed CommandFailed to be a subclass of CommandExit (Bitbake rev: c51ed5d7a9971fad6019dac6c35a71b8a54ab16a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04cooker: add shutdown/stop methodsChris Larson
(Bitbake rev: fc64eff03fe1f41e59128cb3df0ef2161e24a8cb) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04cooker: merge cookerState and cookerActionChris Larson
(Bitbake rev: c7c8945ef7ca9465312e630b7fa5f0a87ac8b6c7) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Add missing 'return False' to the SystemExit handler in runAsyncCommandChris Larson
(Bitbake rev: 966490c555cbdc09f52e1dcc68d3772c28ad9cee) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Handle SystemExit and KeyboardInterrupt sanely when executing a commandChris Larson
(Bitbake rev: 17f40d036814e4abf6d87363fff7823c8c85c298) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Formatting cleanupsChris Larson
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25bb/command was importing bb and accessing some of its own classes indirectly ↵Chris Larson
as bb.command.<class> (Bitbake rev: 4b2a268ce8dad63d21619c1b9acc1de86d222d93) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20bitbake: Switch to bitbake-dev version (bitbake master upstream)Richard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>