[Yum-devel] [PATCH] bash completion: load yum.bash in. BZ 953210

Ville Skyttä ville.skytta at iki.fi
Thu Apr 18 15:23:30 UTC 2013


On 2013-04-18 11:26, Zdenek Pavlas wrote:
> ---
>  yum-utils.bash | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/yum-utils.bash b/yum-utils.bash
> index 20e8e5c..6578bb3 100644
> --- a/yum-utils.bash
> +++ b/yum-utils.bash
> @@ -1,3 +1,6 @@
> +# need functions from yum.bash
> +type -t _yum >/dev/null || . $(pkg-config --variable=completionsdir bash-completion)/yum
> +

For bash-completion >= 2.0 we have _xfunc for this purpose -- it'll pull
in "external" completion functions on demand if they're not available.
Using it in yum-utils is a matter of prepending "_xfunc yum " to all
calls of functions that are in yum's. There are some examples of this in
bash-completion itself.

BTW if assuming presence of bash-completion >= 2.0 is acceptable, there
are a few things that could be cleaned up.


More information about the Yum-devel mailing list