- No longer ship completion for secret-tool, which belongs to
libsecret and newly brings the completions by itself. https://github.com/scop/bash-completion/issues/1317 OBS-URL: https://build.opensuse.org/package/show/shells/bash-completion?expand=0&rev=142
This commit is contained in:
commit
b096eee1f3
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.osc
|
79
FOO-dir-completion-boo905348.patch
Normal file
79
FOO-dir-completion-boo905348.patch
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 38 +++++++++++++++++++++++++++++++++
|
||||||
|
bash-completion-2.12.0/completions/cd | 11 ++++++++-
|
||||||
|
2 files changed, 48 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 07:34:25.733559088 +0000
|
||||||
|
@@ -1102,6 +1102,7 @@ _comp_quote_compgen()
|
||||||
|
_comp_compgen_filedir()
|
||||||
|
{
|
||||||
|
_comp_compgen_tilde && return
|
||||||
|
+ _comp_compgen_dollar "$cur" || return
|
||||||
|
|
||||||
|
local -a toks
|
||||||
|
local _arg=${1-}
|
||||||
|
@@ -1775,6 +1776,43 @@ _comp_compgen_tilde()
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
+# Perform dollar ($ or backtick) completion
|
||||||
|
+# @return True (0) if completion needs further processing,
|
||||||
|
+# False (> 0) if dollar or backtick is for commands, also if dollar
|
||||||
|
+# is used for variables, completions are put in COMPREPLY and noq
|
||||||
|
+# further processing is necessary.
|
||||||
|
+_comp_compgen_dollar()
|
||||||
|
+{
|
||||||
|
+ local s=""
|
||||||
|
+ local -i glob=0
|
||||||
|
+
|
||||||
|
+ shopt -q extglob && let glob++
|
||||||
|
+ ((glob == 0)) && shopt -s extglob
|
||||||
|
+
|
||||||
|
+ [[ "$COMP_LINE" == cd* ]] && s="/"
|
||||||
|
+
|
||||||
|
+ case "$1" in
|
||||||
|
+ \$\(*|\`*)
|
||||||
|
+ COMPREPLY=($(compgen -c -P '$(' -S ")$s" -- ${1#??})) ;;
|
||||||
|
+ \$\{*)
|
||||||
|
+ COMPREPLY=($(compgen -v -P '${' -S "}$s" -- ${1#??})) ;;
|
||||||
|
+ \$*)
|
||||||
|
+ COMPREPLY=($(compgen -v -P '$' ${s:+-S $s} -- ${1#?})) ;;
|
||||||
|
+ *)
|
||||||
|
+ ((glob == 0)) && shopt -u extglob
|
||||||
|
+ return 0
|
||||||
|
+ esac
|
||||||
|
+
|
||||||
|
+ if ((${#COMPREPLY[@]} > 0)) ; then
|
||||||
|
+ ((${#COMPREPLY[@]} == 1)) && eval COMPREPLY=\(${COMPREPLY[@]}\)
|
||||||
|
+ else
|
||||||
|
+ eval COMPREPLY=\(${1}\)
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
+ ((glob == 0)) && shopt -u extglob
|
||||||
|
+ return ${#COMPREPLY[@]}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
# Expand string starting with tilde (~)
|
||||||
|
# We want to expand ~foo/... to /home/foo/... to avoid problems when
|
||||||
|
# word-to-complete starting with a tilde is fed to commands and ending up
|
||||||
|
--- bash-completion-2.12.0/completions/cd
|
||||||
|
+++ bash-completion-2.12.0/completions/cd 2024-02-23 07:45:00.565836867 +0000
|
||||||
|
@@ -5,7 +5,16 @@
|
||||||
|
_comp_cmd_cd()
|
||||||
|
{
|
||||||
|
local cur prev words cword comp_args
|
||||||
|
- _comp_initialize -- "$@" || return
|
||||||
|
+ _comp_initialize -- "$@" || {
|
||||||
|
+ if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
|
||||||
|
+ local i=${COMPREPLY[0]}
|
||||||
|
+ if [[ "$i" == "$cur" && $i != "*/" ]]; then
|
||||||
|
+ _comp_compgen_dollar "$i" || return
|
||||||
|
+ COMPREPLY[0]="${i%%/}/"
|
||||||
|
+ fi
|
||||||
|
+ fi
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
_comp_compgen_help -c help "$1"
|
96
LVM-completion-bsc946875.patch
Normal file
96
LVM-completion-bsc946875.patch
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
There are the following problems with lvm completions:
|
||||||
|
1)_lvm_physicalvolumes() only gets PVs that belong to a VG. In some
|
||||||
|
cases like pvremove we can use all PVs including those not included
|
||||||
|
in any VGs.
|
||||||
|
solution: Add _lvm_physicalvolumes_all to get all PVs and correct
|
||||||
|
all the commands.
|
||||||
|
|
||||||
|
2)pvcreate should be able to use all block devcices.
|
||||||
|
solution: Add _lvm_filedir() to use _filedir except set $cur to /dev
|
||||||
|
when $cur is empty.
|
||||||
|
|
||||||
|
3)when /etc/lvm/lvm.conf silent is 1 there is no output for vg/lv/pvscan,
|
||||||
|
bash-completion will not work.
|
||||||
|
solution: Check the value of silent option. If it is 1 then temporarily
|
||||||
|
set silent 0 and recover back to 1 after the command executed.
|
||||||
|
|
||||||
|
Signed-off-by: Liuhua Wang <lwang@suse.com>
|
||||||
|
Reviewed-by: Lidong Zhong <lzhong@suse.com>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Index: bash-completion-2.11/completions/lvm
|
||||||
|
===================================================================
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/completions/lvm | 26 ++++++++++++++++++++------
|
||||||
|
1 file changed, 20 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/completions/lvm
|
||||||
|
+++ bash-completion-2.12.0/completions/lvm 2024-02-23 08:05:52.542682924 +0000
|
||||||
|
@@ -5,27 +5,41 @@ _comp_cmd_lvm__filedir()
|
||||||
|
_comp_compgen -c "${cur:-/dev/}" filedir
|
||||||
|
}
|
||||||
|
|
||||||
|
+_comp_cmd_lvm__verbose()
|
||||||
|
+{
|
||||||
|
+ local silent=$(sed -n -e "s|^[ \t]*silent[ \t]*=[ \t]*\([01]\)|\1|p" /etc/lvm/lvm.conf)
|
||||||
|
+ test ${silent:-0} -eq 1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
_comp_cmd_lvm__volumegroups()
|
||||||
|
{
|
||||||
|
- _comp_compgen_split -- "$(vgscan 2>/dev/null |
|
||||||
|
+ local verbose
|
||||||
|
+ _comp_cmd_lvm__verbose && verbose=-v
|
||||||
|
+ _comp_compgen_split -- "$(vgscan $verbose 2>/dev/null |
|
||||||
|
command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p')"
|
||||||
|
}
|
||||||
|
|
||||||
|
_comp_cmd_lvm__physicalvolumes_all()
|
||||||
|
{
|
||||||
|
- _comp_compgen_split -- "$(pvscan 2>/dev/null |
|
||||||
|
+ local verbose
|
||||||
|
+ _comp_cmd_lvm__verbose && verbose=-v
|
||||||
|
+ _comp_compgen_split -- "$(pvscan $verbose 2>/dev/null |
|
||||||
|
command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p')"
|
||||||
|
}
|
||||||
|
|
||||||
|
_comp_cmd_lvm__physicalvolumes()
|
||||||
|
{
|
||||||
|
- _comp_compgen_split -- "$(pvscan 2>/dev/null |
|
||||||
|
+ local verbose
|
||||||
|
+ _comp_cmd_lvm__verbose && verbose=-v
|
||||||
|
+ _comp_compgen_split -- "$(pvscan $verbose 2>/dev/null |
|
||||||
|
command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p')"
|
||||||
|
}
|
||||||
|
|
||||||
|
_comp_cmd_lvm__logicalvolumes()
|
||||||
|
{
|
||||||
|
- _comp_compgen_split -- "$(lvscan 2>/dev/null |
|
||||||
|
+ local verbose
|
||||||
|
+ _comp_cmd_lvm__verbose && verbose=-v
|
||||||
|
+ _comp_compgen_split -- "$(lvscan $verbose 2>/dev/null |
|
||||||
|
command sed -n -e "s|^.*'\(.*\)'.*$|\1|p")"
|
||||||
|
if [[ $cur == /dev/mapper/* ]]; then
|
||||||
|
_comp_compgen -a filedir
|
||||||
|
@@ -403,7 +417,7 @@ _comp_cmd_vgreduce()
|
||||||
|
if ((REPLY == 0)); then
|
||||||
|
_comp_cmd_lvm__volumegroups
|
||||||
|
else
|
||||||
|
- _comp_cmd_lvm__physicalvolumes
|
||||||
|
+ _comp_cmd_lvm__physicalvolumes_all
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
@@ -735,7 +749,7 @@ _comp_cmd_lvcreate()
|
||||||
|
if ((REPLY == 0)); then
|
||||||
|
_comp_cmd_lvm__volumegroups
|
||||||
|
else
|
||||||
|
- _comp_cmd_lvm__physicalvolumes
|
||||||
|
+ _comp_cmd_lvm__physicalvolumes_all
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
} &&
|
4
_multibuild
Normal file
4
_multibuild
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<multibuild>
|
||||||
|
<flavor>doc</flavor>
|
||||||
|
</multibuild>
|
||||||
|
|
41
backtick-completion-boo940835.patch
Normal file
41
backtick-completion-boo940835.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 15 ++++++++++-----
|
||||||
|
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 07:56:27.581141856 +0000
|
||||||
|
@@ -1784,16 +1784,21 @@ _comp_compgen_tilde()
|
||||||
|
_comp_compgen_dollar()
|
||||||
|
{
|
||||||
|
local s=""
|
||||||
|
- local -i glob=0
|
||||||
|
-
|
||||||
|
+ local -i glob=0 cmd=0
|
||||||
|
shopt -q extglob && let glob++
|
||||||
|
((glob == 0)) && shopt -s extglob
|
||||||
|
|
||||||
|
[[ "$COMP_LINE" == cd* ]] && s="/"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
- \$\(*|\`*)
|
||||||
|
- COMPREPLY=($(compgen -c -P '$(' -S ")$s" -- ${1#??})) ;;
|
||||||
|
+ \$\(*)
|
||||||
|
+ COMPREPLY=($(compgen -c -P '$(' -S ")$s" -- ${1#??}))
|
||||||
|
+ let cmd++
|
||||||
|
+ ;;
|
||||||
|
+ \`*)
|
||||||
|
+ COMPREPLY=($(compgen -c -P '\`' -S "\`$s" -- ${1#?}))
|
||||||
|
+ let cmd++
|
||||||
|
+ ;;
|
||||||
|
\$\{*)
|
||||||
|
COMPREPLY=($(compgen -v -P '${' -S "}$s" -- ${1#??})) ;;
|
||||||
|
\$*)
|
||||||
|
@@ -1805,7 +1810,7 @@ _comp_compgen_dollar()
|
||||||
|
|
||||||
|
if ((${#COMPREPLY[@]} > 0)) ; then
|
||||||
|
((${#COMPREPLY[@]} == 1)) && eval COMPREPLY=\(${COMPREPLY[@]}\)
|
||||||
|
- else
|
||||||
|
+ elif ((cmd == 0)); then
|
||||||
|
eval COMPREPLY=\(${1}\)
|
||||||
|
fi
|
||||||
|
|
43
backticks-bsc963140.patch
Normal file
43
backticks-bsc963140.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 20 ++++++++++++++------
|
||||||
|
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 08:14:51.140697234 +0000
|
||||||
|
@@ -1791,13 +1791,21 @@ _comp_compgen_dollar()
|
||||||
|
[[ "$COMP_LINE" == cd* ]] && s="/"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
+ \$\(*\))
|
||||||
|
+ ((glob == 0)) && shopt -u extglob
|
||||||
|
+ return 0
|
||||||
|
+ ;;
|
||||||
|
\$\(*)
|
||||||
|
- COMPREPLY=($(compgen -c -P '$(' -S ")$s" -- ${1#??}))
|
||||||
|
- let cmd++
|
||||||
|
+ COMPREPLY=($(compgen -c -P '$(' -S ")$s" -- ${1:2}))
|
||||||
|
+ ((${#COMPREPLY[@]} <= 0)) && let cmd++
|
||||||
|
+ ;;
|
||||||
|
+ \`*\`)
|
||||||
|
+ ((glob == 0)) && shopt -u extglob
|
||||||
|
+ return 0
|
||||||
|
;;
|
||||||
|
\`*)
|
||||||
|
- COMPREPLY=($(compgen -c -P '\`' -S "\`$s" -- ${1#?}))
|
||||||
|
- let cmd++
|
||||||
|
+ COMPREPLY=($(compgen -c -P '\`' -S "\`$s" -- ${1:1}))
|
||||||
|
+ ((${#COMPREPLY[@]} <= 0)) && let cmd++
|
||||||
|
;;
|
||||||
|
\$\{*)
|
||||||
|
COMPREPLY=($(compgen -v -P '${' -S "}$s" -- ${1#??})) ;;
|
||||||
|
@@ -1810,8 +1818,8 @@ _comp_compgen_dollar()
|
||||||
|
|
||||||
|
if ((${#COMPREPLY[@]} > 0)) ; then
|
||||||
|
((${#COMPREPLY[@]} == 1)) && eval COMPREPLY=\(${COMPREPLY[@]}\)
|
||||||
|
- elif ((cmd == 0)); then
|
||||||
|
- eval COMPREPLY=\(${1}\)
|
||||||
|
+ elif ((cmd > 0)); then
|
||||||
|
+ compopt -o default -o bashdefault -o nospace
|
||||||
|
fi
|
||||||
|
|
||||||
|
((glob == 0)) && shopt -u extglob
|
3
bash-completion-2.12.0.tar.xz
Normal file
3
bash-completion-2.12.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:3eb05b1783c339ef59ed576afb0f678fa4ef49a6de8a696397df3148f8345af9
|
||||||
|
size 417272
|
26
bash-completion-2.4.patch
Normal file
26
bash-completion-2.4.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 11 ++++++-----
|
||||||
|
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-22 14:42:03.923479796 +0000
|
||||||
|
@@ -2989,13 +2989,14 @@ _comp_complete_longopt()
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# makeinfo and texi2dvi are defined elsewhere.
|
||||||
|
-complete -F _comp_complete_longopt \
|
||||||
|
+complete -F _comp_complete_longopt -o filenames \
|
||||||
|
a2ps awk base64 bash bc bison cat chroot colordiff cp \
|
||||||
|
- csplit cut date df diff dir du enscript env expand fmt fold gperf \
|
||||||
|
+ csplit cut date df diff dir du enscript expand fmt fold gperf \
|
||||||
|
grep grub head irb ld ldd less ln ls m4 mkdir mkfifo mknod \
|
||||||
|
- mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
|
||||||
|
- sed seq shar sort split strip sum tac tail tee \
|
||||||
|
- texindex touch tr uname unexpand uniq units vdir wc who
|
||||||
|
+ mv nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
|
||||||
|
+ sed shar sort split strip sum tac tail tee \
|
||||||
|
+ texindex touch tr unexpand uniq vdir wc who
|
||||||
|
+complete -F _comp_complete_longopt -o default env netstat seq uname units
|
||||||
|
|
||||||
|
# @since 2.12
|
||||||
|
declare -Ag _comp_xspecs
|
26
bash-completion-2.7-unRAR-remove.patch
Normal file
26
bash-completion-2.7-unRAR-remove.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
Due legal issue the unRAR part of 7z had been removed (boo#1077978, boo#1090515)
|
||||||
|
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/completions/7z | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/completions/7z
|
||||||
|
+++ bash-completion-2.12.0/completions/7z 2024-02-23 08:20:37.142193535 +0000
|
||||||
|
@@ -66,7 +66,7 @@ _comp_cmd_7z()
|
||||||
|
else
|
||||||
|
_comp_compgen -c "${cur:2}" -- -P"${cur:0:2}" -W '7z apm arj
|
||||||
|
bzip2 cab chm cpio cramfs deb dmg elf fat flv gzip hfs iso
|
||||||
|
- lzh lzma lzma86 macho mbr mslz mub nsis ntfs pe ppmd rar
|
||||||
|
+ lzh lzma lzma86 macho mbr mslz mub nsis ntfs pe ppmd
|
||||||
|
rpm squashfs swf swfc tar udf vhd wim xar xz z zip'
|
||||||
|
fi
|
||||||
|
return
|
||||||
|
@@ -98,7 +98,7 @@ _comp_cmd_7z()
|
||||||
|
# (assumption: extensions are all lowercase)
|
||||||
|
[[ $mode == w ]] &&
|
||||||
|
_comp_compgen -a filedir '@(7z|bz2|swf|?(g)tar|?(t)[bglx]z|tb?(z)2|wim)' ||
|
||||||
|
- _comp_compgen -a filedir '@(7z?(.001)|arj|bz2|cab|cb7|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|msi|pmd|[rx]ar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)'
|
||||||
|
+ _comp_compgen -a filedir '@(7z?(.001)|arj|bz2|cab|cb7|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|msi|pmd|xar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)'
|
||||||
|
else
|
||||||
|
if [[ ${words[1]} == d ]]; then
|
||||||
|
_comp_compgen_split -l -- "$(
|
1
bash-completion-rpmlintrc
Normal file
1
bash-completion-rpmlintrc
Normal file
@ -0,0 +1 @@
|
|||||||
|
addFilter("E:.*filelist-forbidden-bashcomp-userdirs.*/etc/bash_completion.d/000_bash_completion_compat.bash")
|
2185
bash-completion.changes
Normal file
2185
bash-completion.changes
Normal file
File diff suppressed because it is too large
Load Diff
180
bash-completion.spec
Normal file
180
bash-completion.spec
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
#
|
||||||
|
# spec file for package bash-completion
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 SUSE LLC
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
|
|
||||||
|
%if "%{flavor}" == "doc"
|
||||||
|
%define build_core 0
|
||||||
|
%define build_doc 1
|
||||||
|
%define nsuffix -doc
|
||||||
|
%else
|
||||||
|
%define build_core 1
|
||||||
|
%define build_doc 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%global _name bash-completion
|
||||||
|
Name: %{_name}%{?nsuffix}
|
||||||
|
Version: 2.12.0
|
||||||
|
Release: 0
|
||||||
|
%if %{build_core}
|
||||||
|
Summary: Programmable Completion for Bash
|
||||||
|
License: GPL-2.0-or-later
|
||||||
|
%else
|
||||||
|
Summary: The Documentation of Programmable Completion for Bash
|
||||||
|
License: GPL-2.0-or-later
|
||||||
|
Provides: bash-completion:%{_defaultdocdir}/%{_name}/AUTHORS
|
||||||
|
%endif
|
||||||
|
URL: https://github.com/scop/bash-completion/
|
||||||
|
Source0: https://github.com/scop/bash-completion/releases/download/%{version}/%{_name}-%{version}.tar.xz
|
||||||
|
Source1: bash-completion-rpmlintrc
|
||||||
|
# PATCH-FIX-UPSTREAM bnc#717151 -- Terminal tab autocompletion error
|
||||||
|
Patch0: %{_name}-2.4.patch
|
||||||
|
# PATCH-FIX-SUSE bnc#1012212 -- bash tab-autocompletion hangs on TAR-archiving with --create key
|
||||||
|
Patch1: tar-completion.patch
|
||||||
|
# PATCH-FIX-SUSE boo#905348 -- tab completion with shell variable changes command line with backslash
|
||||||
|
Patch3: FOO-dir-completion-boo905348.patch
|
||||||
|
# PATCH-FIX-SUSE
|
||||||
|
Patch4: qdbus-qt5.patch
|
||||||
|
# PATCH-FIX-SUSE boo#889319
|
||||||
|
Patch5: ls-completion-boo889319.patch
|
||||||
|
# PATCH-FIX-SUSE boo#940835
|
||||||
|
Patch6: backtick-completion-boo940835.patch
|
||||||
|
# PATCH-FIX-SUSE bsc#946875
|
||||||
|
Patch7: LVM-completion-bsc946875.patch
|
||||||
|
# PATCH-FIX-SUSE boo#940837, bsc#959299
|
||||||
|
Patch8: respect-variables-boo940837.patch
|
||||||
|
# PATCH-FIX-SUSE boo#958462
|
||||||
|
Patch9: rm-completion-smart-boo958462.patch
|
||||||
|
# PATCH-FIX-SUSE boo#963140
|
||||||
|
Patch10: backticks-bsc963140.patch
|
||||||
|
# PATCH-FIX-SUSE boo#1090515
|
||||||
|
Patch11: bash-completion-2.7-unRAR-remove.patch
|
||||||
|
# PATCH-FIX-SUSE boo#1190929
|
||||||
|
Patch13: boo1190929-9af4afd0.patch
|
||||||
|
# PATCH-FIX-SUSE boo#1199724
|
||||||
|
Patch14: bsc1199724-modules.patch
|
||||||
|
# PATCH-FIX-SUSE boo#1221414 -- shells/bash-completion: Bug
|
||||||
|
Patch15: boo1221414-scp.patch
|
||||||
|
BuildRequires: libtool
|
||||||
|
BuildRequires: pkgconfig
|
||||||
|
BuildArch: noarch
|
||||||
|
%if %{build_doc}
|
||||||
|
BuildRequires: cmark
|
||||||
|
BuildRequires: libxslt-tools
|
||||||
|
%endif
|
||||||
|
%if %{build_core}
|
||||||
|
Requires: bash >= 5.1.16
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
%if %{build_doc}
|
||||||
|
This package contains the package documentation file of the
|
||||||
|
package bash-completion.
|
||||||
|
%else
|
||||||
|
bash-completion is a collection of shell functions that take advantage
|
||||||
|
of the programmable completion feature of Bash 2.04 and later.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: The Configuration of Programmable Completion for Bash
|
||||||
|
Provides: bash-completion:%{_datadir}/pkgconfig/bash-completion.pc
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
This package contains the package configuration file of the
|
||||||
|
package bash-completion.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -n %{_name}-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -fiv
|
||||||
|
%configure
|
||||||
|
%if %{build_core}
|
||||||
|
%make_build
|
||||||
|
%endif
|
||||||
|
%if %{build_doc}
|
||||||
|
pushd doc
|
||||||
|
mkdir html
|
||||||
|
for md in *.md
|
||||||
|
do
|
||||||
|
cmark $md --to html > html/${md%%.md}.html
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%install
|
||||||
|
%if %{build_core}
|
||||||
|
%make_install
|
||||||
|
# shipping in latest systemd now
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/udevadm
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/nmcli
|
||||||
|
# shipping in latest util-linux now
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/cal
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/chsh
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/dmesg
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/eject
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/hexdump
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/hwclock
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/ionice
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/look
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/mount
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/newgrp
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/renice
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/rtcwake
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/su
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/umount
|
||||||
|
# shipping in devscripts now
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/bts
|
||||||
|
# shipped as part of libsecret
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/secret-tool
|
||||||
|
# Seems to be broken (boo#1161136)
|
||||||
|
rm -vf %{buildroot}%{_datadir}/bash-completion/completions/_adb
|
||||||
|
%endif
|
||||||
|
%if %{build_doc}
|
||||||
|
pushd doc
|
||||||
|
mkdir -p %{buildroot}%{_defaultdocdir}/%{_name}/html
|
||||||
|
install -m 0644 html/* %{buildroot}%{_defaultdocdir}/%{_name}/html/
|
||||||
|
popd
|
||||||
|
install -m 0644 AUTHORS %{buildroot}%{_defaultdocdir}/%{_name}/
|
||||||
|
install -m 0644 README.md %{buildroot}%{_defaultdocdir}/%{_name}/README
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files
|
||||||
|
%if "%{flavor}" == "doc"
|
||||||
|
%dir %{_defaultdocdir}/%{_name}
|
||||||
|
%{_defaultdocdir}/%{_name}/AUTHORS
|
||||||
|
%{_defaultdocdir}/%{_name}/README
|
||||||
|
%{_defaultdocdir}/%{_name}/html/
|
||||||
|
%else
|
||||||
|
%license COPYING
|
||||||
|
%dir %{_sysconfdir}/bash_completion.d/
|
||||||
|
%{_sysconfdir}/bash_completion.d/000_bash_completion_compat.bash
|
||||||
|
%{_datadir}/bash-completion
|
||||||
|
%config %{_sysconfdir}/profile.d/bash_completion.sh
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%dir %{_datadir}/cmake
|
||||||
|
%{_datadir}/cmake/bash-completion
|
||||||
|
%{_datadir}/pkgconfig/bash-completion.pc
|
||||||
|
# TRICK: bash-completion-devel does not require bash-completion.
|
||||||
|
# It would cause failure of directory ownership check.
|
||||||
|
# Own this directory to prevent it.
|
||||||
|
%dir %{_datadir}/bash-completion
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
46
boo1190929-9af4afd0.patch
Normal file
46
boo1190929-9af4afd0.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
From: Werner Fink <werner@suse.de>
|
||||||
|
Date: Mon, 04 Oct 2021 15:38:08 +0200
|
||||||
|
Subject: Also support .bz2 compressed kernel modules
|
||||||
|
|
||||||
|
---
|
||||||
|
completions/insmod | 2 +-
|
||||||
|
completions/modinfo | 2 +-
|
||||||
|
completions/modprobe | 2 +-
|
||||||
|
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/completions/insmod b/completions/insmod
|
||||||
|
--- a/completions/insmod
|
||||||
|
+++ b/completions/insmod
|
||||||
|
@@ -7,7 +7,7 @@ _comp_cmd_insmod()
|
||||||
|
|
||||||
|
# do filename completion for first argument
|
||||||
|
if ((cword == 1)); then
|
||||||
|
- _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst))'
|
||||||
|
+ _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
|
||||||
|
else # do module parameter completion
|
||||||
|
_comp_compgen_split -- "$(PATH="$PATH:/sbin" modinfo \
|
||||||
|
-p "${words[1]}" 2>/dev/null | cut -d: -f1)"
|
||||||
|
diff --git a/completions/modinfo b/completions/modinfo
|
||||||
|
--- a/completions/modinfo
|
||||||
|
+++ b/completions/modinfo
|
||||||
|
@@ -43,7 +43,7 @@ _comp_cmd_modinfo()
|
||||||
|
|
||||||
|
# do filename completion if we're giving a path to a module
|
||||||
|
if [[ $cur == @(*/|[.~])* ]]; then
|
||||||
|
- _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst))'
|
||||||
|
+ _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
|
||||||
|
else
|
||||||
|
_comp_compgen_kernel_modules "$version"
|
||||||
|
fi
|
||||||
|
diff --git a/completions/modprobe b/completions/modprobe
|
||||||
|
--- a/completions/modprobe
|
||||||
|
+++ b/completions/modprobe
|
||||||
|
@@ -83,7 +83,7 @@ _comp_cmd_modprobe()
|
||||||
|
insert)
|
||||||
|
# do filename completion if we're giving a path to a module
|
||||||
|
if [[ $cur == @(*/|[.~])* ]]; then
|
||||||
|
- _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst))'
|
||||||
|
+ _comp_compgen_filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
|
||||||
|
elif [[ $module ]]; then
|
||||||
|
# do module parameter completion
|
||||||
|
if [[ $cur == *=* ]]; then
|
17
boo1221414-scp.patch
Normal file
17
boo1221414-scp.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Do not replace COMPREPLY with _comp_compgen_split()
|
||||||
|
|
||||||
|
---
|
||||||
|
completions/ssh | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/completions/ssh
|
||||||
|
+++ b/completions/ssh 2024-03-22 13:27:49.715476006 +0000
|
||||||
|
@@ -499,7 +499,7 @@ _comp_xfunc_scp_compgen_remote_files()
|
||||||
|
command sed -e 's/'"$_comp_cmd_scp__path_esc"'/\\\\\\&/g' -e 's/[*@|=]$//g' \
|
||||||
|
-e 's/[^\/]$/& /g')
|
||||||
|
fi
|
||||||
|
- _comp_compgen_split -l -- "$_files"
|
||||||
|
+ COMPREPLY+=( $_files )
|
||||||
|
}
|
||||||
|
|
||||||
|
# @deprecated 2.12 use `_comp_compgen -ax ssh remote_files` instead
|
16
bsc1199724-modules.patch
Normal file
16
bsc1199724-modules.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
bash_completion | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/bash_completion b/bash_completion
|
||||||
|
--- a/bash_completion
|
||||||
|
+++ b/bash_completion
|
||||||
|
@@ -2090,7 +2090,7 @@ _comp_compgen_kernel_modules()
|
||||||
|
local _modpath=/lib/modules/$1
|
||||||
|
_comp_compgen_split -- "$(command ls -RL "$_modpath" 2>/dev/null |
|
||||||
|
command sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p' \
|
||||||
|
- -e 's/^\(.*\)\.ko\.zst$/\1/p')"
|
||||||
|
+ -e 's/^\(.*\)\.ko\.zst$/\1/p' -e 's/^\(.*\)\.ko\.bz2$/\1/p')"
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function completes on inserted kernel modules
|
20
ls-completion-boo889319.patch
Normal file
20
ls-completion-boo889319.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 07:54:39.219148113 +0000
|
||||||
|
@@ -3030,11 +3030,12 @@ _comp_complete_longopt()
|
||||||
|
complete -F _comp_complete_longopt -o filenames \
|
||||||
|
a2ps awk base64 bash bc bison cat chroot colordiff cp \
|
||||||
|
csplit cut date df diff dir du enscript expand fmt fold gperf \
|
||||||
|
- grep grub head irb ld ldd less ln ls m4 mkdir mkfifo mknod \
|
||||||
|
+ grep grub head irb ld ldd less ln m4 mkdir mkfifo mknod \
|
||||||
|
mv nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
|
||||||
|
sed shar sort split strip sum tac tail tee \
|
||||||
|
texindex touch tr unexpand uniq vdir wc who
|
||||||
|
complete -F _comp_complete_longopt -o default env netstat seq uname units
|
||||||
|
+complete -F _comp_complete_longopt -o bashdefault -o default -o filenames ls ll la l ls-l lf
|
||||||
|
|
||||||
|
# @since 2.12
|
||||||
|
declare -Ag _comp_xspecs
|
42
qdbus-qt5.patch
Normal file
42
qdbus-qt5.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From: Fabian Vogt <fvogt@suse.de>
|
||||||
|
Subject: Add completion for qdbus-qt5
|
||||||
|
|
||||||
|
qdbus is the Qt 4 variant, also complete for the Qt 5 version.
|
||||||
|
|
||||||
|
Index: bash-completion-2.11/completions/qdbus
|
||||||
|
===================================================================
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/completions/Makefile.am | 4 +++-
|
||||||
|
bash-completion-2.12.0/completions/qdbus | 2 +-
|
||||||
|
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/completions/Makefile.am
|
||||||
|
+++ bash-completion-2.12.0/completions/Makefile.am 2024-02-23 09:21:49.726811653 +0000
|
||||||
|
@@ -821,6 +821,8 @@ CLEANFILES = \
|
||||||
|
pyvenv-3.10 \
|
||||||
|
pyvenv-3.11 \
|
||||||
|
pyvenv-3.12 \
|
||||||
|
+ qdbus-qt5 \
|
||||||
|
+ qdbus6 \
|
||||||
|
qemu-kvm \
|
||||||
|
qemu-system-i386 \
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
@@ -1169,7 +1171,7 @@ symlinks: $(DATA)
|
||||||
|
pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 \
|
||||||
|
pyvenv-3.9 pyvenv-3.10 pyvenv-3.11 pyvenv-3.12
|
||||||
|
$(ss) qdbus \
|
||||||
|
- dcop
|
||||||
|
+ dcop qdbus-qt5 qdbus6
|
||||||
|
$(ss) qemu \
|
||||||
|
qemu-kvm qemu-system-i386 qemu-system-x86_64
|
||||||
|
$(ss) quota \
|
||||||
|
--- bash-completion-2.12.0/completions/qdbus
|
||||||
|
+++ bash-completion-2.12.0/completions/qdbus 2024-02-23 09:20:07.148708732 +0000
|
||||||
|
@@ -9,6 +9,6 @@ _comp_cmd_qdbus()
|
||||||
|
command "${words[@]::cword}" 2>/dev/null | command sed 's/(.*)//'
|
||||||
|
)"
|
||||||
|
} &&
|
||||||
|
- complete -F _comp_cmd_qdbus qdbus dcop
|
||||||
|
+ complete -F _comp_cmd_qdbus qdbus qdbus-qt5 qdbus6 dcop
|
||||||
|
|
||||||
|
# ex: filetype=sh
|
34
respect-variables-boo940837.patch
Normal file
34
respect-variables-boo940837.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Bug boo#940837
|
||||||
|
Bug bsc#959299
|
||||||
|
|
||||||
|
That is do not escape the dollar character of a variable to allow
|
||||||
|
commands like `ls' to go further in its completion chain.
|
||||||
|
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 15 +++++++++++++--
|
||||||
|
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 08:10:16.777791836 +0000
|
||||||
|
@@ -2984,8 +2984,19 @@ _comp_compgen_commands()
|
||||||
|
# @since 2.12
|
||||||
|
_comp_complete_longopt()
|
||||||
|
{
|
||||||
|
- local cur prev words cword was_split comp_args
|
||||||
|
- _comp_initialize -s -- "$@" || return
|
||||||
|
+ local cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
+ local prev words cword was_split comp_args
|
||||||
|
+
|
||||||
|
+ if [[ "${cur:0:1}" == '$' ]] ; then
|
||||||
|
+ compopt -o dirnames +o filenames
|
||||||
|
+ else
|
||||||
|
+ compopt +o dirnames -o filenames
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
+ _comp_initialize -s -- "$@" || {
|
||||||
|
+ _comp_compgen_dollar "$cur"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
|
||||||
|
case "${prev,,}" in
|
||||||
|
--help | --usage | --version)
|
25
rm-completion-smart-boo958462.patch
Normal file
25
rm-completion-smart-boo958462.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Bug boo#958462
|
||||||
|
|
||||||
|
Allow the smart bash builtin completion if normal completion scripting
|
||||||
|
does not return anything.
|
||||||
|
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/bash_completion | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/bash_completion
|
||||||
|
+++ bash-completion-2.12.0/bash_completion 2024-02-23 08:12:55.346856835 +0000
|
||||||
|
@@ -3047,11 +3047,12 @@ complete -F _comp_complete_longopt -o fi
|
||||||
|
a2ps awk base64 bash bc bison cat chroot colordiff cp \
|
||||||
|
csplit cut date df diff dir du enscript expand fmt fold gperf \
|
||||||
|
grep grub head irb ld ldd less ln m4 mkdir mkfifo mknod \
|
||||||
|
- mv nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
|
||||||
|
+ mv nl nm objcopy objdump od paste pr ptx readelf \
|
||||||
|
sed shar sort split strip sum tac tail tee \
|
||||||
|
texindex touch tr unexpand uniq vdir wc who
|
||||||
|
complete -F _comp_complete_longopt -o default env netstat seq uname units
|
||||||
|
complete -F _comp_complete_longopt -o bashdefault -o default -o filenames ls ll la l ls-l lf
|
||||||
|
+complete -F _comp_complete_longopt -o bashdefault -o default -o filenames rm rmdir
|
||||||
|
|
||||||
|
# @since 2.12
|
||||||
|
declare -Ag _comp_xspecs
|
17
tar-completion.patch
Normal file
17
tar-completion.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
boo#1012212 -- bash tab-autocompletion hangs on TAR-archiving with --create key
|
||||||
|
|
||||||
|
---
|
||||||
|
bash-completion-2.12.0/completions/tar | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- bash-completion-2.12.0/completions/tar
|
||||||
|
+++ bash-completion-2.12.0/completions/tar 2024-02-22 15:03:22.400476120 +0000
|
||||||
|
@@ -203,7 +203,7 @@ _comp_cmd_tar__preparse_cmdline()
|
||||||
|
|
||||||
|
for i in "$@"; do
|
||||||
|
case "$i" in
|
||||||
|
- --delete | --test-label)
|
||||||
|
+ --delete|--test-label|--catenate|--concatenate|--extract|--get|--update|--list|--append|--create)
|
||||||
|
tar_mode=${i:2:100}
|
||||||
|
tar_mode_arg=$i
|
||||||
|
break
|
Loading…
x
Reference in New Issue
Block a user