This plugins adds completion for the
bitbake command line tool in Zsh, but
also for devtool and bitbake-layers.
-
-
Clone this repository in
$HOME/.oh-my-zsh/custom/plugins/:git clone https://github.com/antznin/zsh-bitbake.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-bitbake -
Add
zsh-bitbaketo the plugins array in your zshrc file:plugins=(... zsh-bitbake)
-
-
To install the plugin separately, clone this repository and source
bitbake.plugin.zshin your zshrc. Then add this repository's path to the completion path:source ".../zsh-bitbake/bitbake.plugin.zsh" fpath+=".../zsh-bitbake" autoload -U compinit compinit
-
ZSH_BITBAKE_DISABLE_RECIPE_COMPLETION: an initial command is run to create a text file listing all available recipes in the current bitbake environment. The file is located in$BUILDDIR/.recipe-cache.This can take a while depending on the state the build environment. To disable this feature, set
ZSH_BITBAKE_DISABLE_RECIPE_COMPLETIONto any value in your zshrc.
Completion of arguments works normally as any other zsh completion, with additional suggestions when possible (common bitbake tasks, debug domains…).
Completion of recipes works differently as it depends on the environment. When
trying to complete a recipe for the first time in the current environment, the
bitbake-layers show-recipes command is run to fetch the complete list of
recipes.
This command execution has a few requirements (not run and quietly exited if unmet):
-
ZSH_BITBAKE_DISABLE_RECIPE_COMPLETIONis not set (see Configuration). -
BUILDDIRis a directory. This variable is set by theoe-init-build-envscript. -
Commands
bitbake-layers,sed, andtailexist in the current shell.
This creates a file $BUILDDIR/.recipe-cache that stores the list of recipes.
Recipes are read from this file to enable completion. This file is not
automatically updated if recipes are added or removed in the current environment
(it would be too slow and costly). File must be removed to be regenerated on the
next completion.
The completion engine will also try to look in your current devtool workspace
for the recipes managed by devtool. It also looks in your conf/bblayers.conf
and tries to find the currently enabled layers.