diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-17 16:08:23 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-17 16:08:23 +0000 |
commit | ea7a06554945ae4a2942a32dc036f4321bbd9eec (patch) | |
tree | 6c21d8b251cd88ae3e34ccacb53beb7c880b38db /3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch | |
parent | 18439c3b0ff1942d76577d2fd71fba0027f387a0 (diff) |
automatic import of dnf5
Diffstat (limited to '3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch')
-rw-r--r-- | 3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch b/3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch new file mode 100644 index 0000000..ef8b3c7 --- /dev/null +++ b/3138fa9e16edb1b0a3c07872815ce68b11c0e154.patch @@ -0,0 +1,34 @@ +From 3138fa9e16edb1b0a3c07872815ce68b11c0e154 Mon Sep 17 00:00:00 2001 +From: Jaroslav Rohel <jrohel@redhat.com> +Date: Tue, 9 Apr 2024 13:24:30 +0200 +Subject: [PATCH] dnf5: bash completion: Prefer using "_comp_initialize" with + fallback + +- ` _comp_initialize` was added in bash-completion 2.12 +- `_init_completion` is deprecated since bash-completion 2.12 +--- + dnf5/bash-completion/dnf5 | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/dnf5/bash-completion/dnf5 b/dnf5/bash-completion/dnf5 +index 95419e5ab..de2745499 100644 +--- a/dnf5/bash-completion/dnf5 ++++ b/dnf5/bash-completion/dnf5 +@@ -3,7 +3,16 @@ + _do_dnf5_completion() + { + local cur prev words cword comp_args +- _init_completion -n "><=;|&(:" -- "$@" || return ++ ++ # Test if bash-completion supports "_comp_initialize" (added in bash-completion 2.12) ++ type _comp_initialize >/dev/null 2>&1 ++ if [[ $? -eq 0 ]]; then ++ _comp_initialize -n "><=;|&(:" -- "$@" || return ++ else ++ # legacy function call (deprecated since bash-completion 2.12) ++ _init_completion -n "><=;|&(:" -- "$@" || return ++ fi ++ + mapfile -t COMPREPLY <<<$("${1}" "--complete=${cword}" "${words[@]}") + } + |