Sync from SUSE:ALP:Source:Standard:1.0 bash-completion revision 00fce5543cadfea11f2033dcdd94cf10

This commit is contained in:
Adrian Schröter 2024-10-14 13:57:27 +02:00
commit bdab5cce30
21 changed files with 2764 additions and 0 deletions

23
.gitattributes vendored Normal file
View 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

View File

@ -0,0 +1,77 @@
---
bash_completion | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -566,6 +566,7 @@ _filedir()
local IFS=$'\n'
_tilde "${cur-}" || return
+ _dollar "$cur" || return
local -a toks
local reset arg=${1-}
@@ -1044,6 +1045,42 @@ _tilde()
return $result
}
+# Perform dollar ($) completion
+# @return True (0) if completion needs further processing,
+# False (> 0) if dollar is followed by a valid username, completions
+# are put in COMPREPLY and no further processing is necessary.
+_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 variable 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
@@ -1810,7 +1847,16 @@ complete -F _known_hosts traceroute trac
_cd()
{
local cur prev words cword
- _init_completion || return
+ _init_completion || {
+ if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
+ local i=${COMPREPLY[0]}
+ if [[ "$i" == "$cur" && $i != "*/" ]]; then
+ _dollar "$i" || return
+ COMPREPLY[0]="${i%%/}/"
+ fi
+ fi
+ return
+ }
local IFS=$'\n' i j k

View File

@ -0,0 +1,92 @@
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.11.orig/completions/lvm
+++ bash-completion-2.11/completions/lvm
@@ -6,27 +6,41 @@ _lvm_filedir()
_filedir
}
+_lvm_verbose()
+{
+ local silent=$(sed -n -e "s|^[ \t]*silent[ \t]*=[ \t]*\([01]\)|\1|p" /etc/lvm/lvm.conf)
+ test ${silent:-0} -eq 1
+}
+
_lvm_volumegroups()
{
- COMPREPLY=($(compgen -W "$(vgscan 2>/dev/null |
+ local verbose
+ _lvm_verbose && verbose=-v
+ COMPREPLY=( $(compgen -W "$( vgscan $verbose 2>/dev/null | \
command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p')" -- "$cur"))
}
_lvm_physicalvolumes_all()
{
- COMPREPLY=($(compgen -W "$(pvscan 2>/dev/null |
+ local verbose
+ _lvm_verbose && verbose=-v
+ COMPREPLY=( $(compgen -W "$( pvscan $verbose 2>/dev/null | \
command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p')" -- "$cur"))
}
_lvm_physicalvolumes()
{
- COMPREPLY=($(compgen -W "$(pvscan 2>/dev/null |
+ local verbose
+ _lvm_verbose && verbose=-v
+ COMPREPLY=( $(compgen -W "$( pvscan $verbose 2>/dev/null | \
command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p')" -- "$cur"))
}
_lvm_logicalvolumes()
{
- COMPREPLY=($(compgen -W "$(lvscan 2>/dev/null |
+ local verbose
+ _lvm_verbose && verbose=-v
+ COMPREPLY=( $(compgen -W "$( lvscan $verbose 2>/dev/null | \
command sed -n -e "s|^.*'\(.*\)'.*$|\1|p")" -- "$cur"))
if [[ $cur == /dev/mapper/* ]]; then
_filedir
@@ -387,7 +401,7 @@ _vgreduce()
if ((args == 0)); then
_lvm_volumegroups
else
- _lvm_physicalvolumes
+ _lvm_physicalvolumes_all
fi
fi
} &&
@@ -701,7 +715,7 @@ _lvcreate()
if ((args == 0)); then
_lvm_volumegroups
else
- _lvm_physicalvolumes
+ _lvm_physicalvolumes_all
fi
fi
} &&

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<flavor>doc</flavor>
</multibuild>

View File

@ -0,0 +1,43 @@
---
bash_completion | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -1052,16 +1052,21 @@ _tilde()
_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#??})) ;;
\$*)
@@ -1073,7 +1078,7 @@ _dollar()
if ((${#COMPREPLY[@]} > 0)) ; then
((${#COMPREPLY[@]} == 1)) && eval COMPREPLY=\(${COMPREPLY[@]}\)
- else
+ elif ((cmd == 0)); then
eval COMPREPLY=\(${1}\)
fi

45
backticks-bsc963140.patch Normal file
View File

@ -0,0 +1,45 @@
---
bash-completion-2.7/bash_completion | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -1059,13 +1059,21 @@ _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#??})) ;;
@@ -1078,8 +1086,8 @@ _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

BIN
bash-completion-2.11.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

27
bash-completion-2.4.patch Normal file
View File

@ -0,0 +1,27 @@
---
bash_completion | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -2031,12 +2031,13 @@ _longopt()
fi
}
# makeinfo and texi2dvi are defined elsewhere.
-complete -F _longopt a2ps awk base64 bash bc bison cat chroot colordiff cp \
- csplit cut date df diff dir du enscript env expand fmt fold gperf \
+complete -F _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 md5sum mkdir mkfifo mknod \
- mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
- sed seq sha{,1,224,256,384,512}sum 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 sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \
+ texindex touch tr unexpand uniq vdir wc who
+complete -F _longopt -o default env netstat seq uname units
declare -Ag _xspecs

View File

@ -0,0 +1,28 @@
Due legal issue the unRAR part of 7z had been removed (boo#1077978, boo#1090515)
---
completions/7z | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: bash-completion-2.11/completions/7z
===================================================================
--- bash-completion-2.11.orig/completions/7z
+++ bash-completion-2.11/completions/7z
@@ -76,7 +76,7 @@ _7z()
else
COMPREPLY=($(compgen -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 rpm
+ lzma86 macho mbr mslz mub nsis ntfs pe ppmd rpm
squashfs swf swfc tar udf vhd wim xar xz z zip' \
-- "${cur:2}"))
fi
@@ -110,7 +110,7 @@ _7z()
# (assumption: extensions are all lowercase)
[[ $mode == w ]] &&
_filedir '@(7z|bz2|swf|?(g)tar|?(t)[bglx]z|tb?(z)2|wim)' ||
- _filedir '@(7z|arj|bz2|cab|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)'
+ _filedir '@(7z|arj|bz2|cab|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
local IFS=$'\n'

View File

@ -0,0 +1,73 @@
From 06f94a5c855fc38c0583a3b65c27c1c814a90bac Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 30 Mar 2020 19:48:39 +0200
Subject: [PATCH] Revert "_filedir: avoid duplicate dirs internally, and a
compgen -d call for files"
This reverts commit da99bc55954e9f60b9c3a9e9071ff6301d7015cb.
References: https://github.com/scop/bash-completion/issues/378 boo#1167952
The solution without calling compgen -d proves unrealiable.
Until this is fixed revert to calling compgen -d for completions with
file pattern.
---
bash_completion | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -571,34 +571,22 @@ _filedir()
local -a toks
local reset arg=${1-}
- if [[ $arg == -d ]]; then
- reset=$(shopt -po noglob)
- set -o noglob
- toks=($(compgen -d -- "${cur-}"))
- IFS=' '
- $reset
- IFS=$'\n'
- else
+ reset=$(shopt -po noglob); set -o noglob
+ toks=( $(compgen -d -- "$cur") )
+ IFS=' '; $reset; IFS=$'\n'
+
+ if [[ "$1" != -d ]]; then
local quoted
_quote_readline_by_ref "${cur-}" quoted
# Munge xspec to contain uppercase version too
# https://lists.gnu.org/archive/html/bug-bash/2010-09/msg00036.html
# news://news.gmane.io/4C940E1C.1010304@case.edu
- local xspec=${arg:+"!*.@($arg|${arg^^})"} plusdirs=()
-
- # Use plusdirs to get dir completions if we have a xspec; if we don't,
- # there's no need, dirs come along with other completions. Don't use
- # plusdirs quite yet if fallback is in use though, in order to not ruin
- # the fallback condition with the "plus" dirs.
- local opts=(-f -X "$xspec")
- [[ $xspec ]] && plusdirs=(-o plusdirs)
- [[ ${COMP_FILEDIR_FALLBACK-} || -z ${plusdirs-} ]] ||
- opts+=("${plusdirs[@]}")
+ local xspec=${1:+"!*.@($1|${1^^})"}
reset=$(shopt -po noglob)
set -o noglob
- toks+=($(compgen "${opts[@]}" -- $quoted))
+ toks+=( $(compgen -f -X "$xspec" -- $quoted) )
IFS=' '
$reset
IFS=$'\n'
@@ -607,7 +595,7 @@ _filedir()
[[ -n ${COMP_FILEDIR_FALLBACK-} && -n $arg && ${#toks[@]} -lt 1 ]] && {
reset=$(shopt -po noglob)
set -o noglob
- toks+=($(compgen -f ${plusdirs+"${plusdirs[@]}"} -- $quoted))
+ toks+=( $(compgen -f -- $quoted) )
IFS=' '
$reset
IFS=$'\n'

View File

@ -0,0 +1 @@
addFilter("bash-completion.noarch: E: devel-file-in-non-devel-package .* /usr/share/pkgconfig/bash-completion.pc")

1909
bash-completion.changes Normal file

File diff suppressed because it is too large Load Diff

175
bash-completion.spec Normal file
View File

@ -0,0 +1,175 @@
#
# spec file for package bash
#
# Copyright (c) 2022 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.11
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#1167952
Patch12: bash-completion-fix-missing-directory-completion-with-filename-pattern.patch
# PATCH-FIX-SUSE boo#1190929
Patch13: boo1190929-9af4afd0.patch
# PATCH-FIX-SUSE boo#1199724
Patch14: bsc1199724-modules.patch
# PATCH-FIX-UPSTREAM bsc#1200791
Patch15: fix-curl-help-completion-bsc1200791.patch
BuildRequires: libtool
BuildRequires: pkgconfig
BuildArch: noarch
%if %{build_doc}
BuildRequires: asciidoc
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
a2x -D html -d book -f xhtml --asciidoc-opts="--unsafe" main.txt
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
# 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
%{_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

89
boo1190929-9af4afd0.patch Normal file
View File

@ -0,0 +1,89 @@
From 9af4afd01facc0dc3407c8b81375bedd4b2f5fa4 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Thu, 30 Sep 2021 12:25:49 +0200
Subject: [PATCH] insmod, modinfo, modprobe: support zstd compressed modules
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
completions/insmod | 2 +-
completions/modinfo | 2 +-
completions/modprobe | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/completions/insmod
+++ b/completions/insmod 2021-10-04 13:34:04.749347460 +0000
@@ -7,7 +7,7 @@ _insmod()
# do filename completion for first argument
if ((cword == 1)); then
- _filedir '@(?(k)o?(.[gx]z))'
+ _filedir '@(?(k)o?(.[gx]z|.zst))'
else # do module parameter completion
COMPREPLY=($(compgen -W "$(PATH="$PATH:/sbin" modinfo \
-p ${words[1]} 2>/dev/null | cut -d: -f1)" -- "$cur"))
--- a/completions/modinfo
+++ b/completions/modinfo 2021-10-04 13:34:04.749347460 +0000
@@ -37,7 +37,7 @@ _modinfo()
# do filename completion if we're giving a path to a module
if [[ $cur == @(*/|[.~])* ]]; then
- _filedir '@(?(k)o?(.[gx]z))'
+ _filedir '@(?(k)o?(.[gx]z|.zst))'
else
_modules $version
fi
--- a/completions/modprobe
+++ b/completions/modprobe 2021-10-04 13:34:04.749347460 +0000
@@ -80,7 +80,7 @@ _modprobe()
insert)
# do filename completion if we're giving a path to a module
if [[ $cur == @(*/|[.~])* ]]; then
- _filedir '@(?(k)o?(.[gx]z))'
+ _filedir '@(?(k)o?(.[gx]z|.zst))'
elif [[ -n $module ]]; then
# do module parameter completion
if [[ $cur == *=* ]]; then
================================================================================
From: Werner Fink <werenr@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(-)
--- a/completions/insmod
+++ b/completions/insmod 2021-10-04 13:35:49.279524797 +0000
@@ -7,7 +7,7 @@ _insmod()
# do filename completion for first argument
if ((cword == 1)); then
- _filedir '@(?(k)o?(.[gx]z|.zst))'
+ _filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
else # do module parameter completion
COMPREPLY=($(compgen -W "$(PATH="$PATH:/sbin" modinfo \
-p ${words[1]} 2>/dev/null | cut -d: -f1)" -- "$cur"))
--- a/completions/modinfo
+++ b/completions/modinfo 2021-10-04 13:35:59.863340257 +0000
@@ -37,7 +37,7 @@ _modinfo()
# do filename completion if we're giving a path to a module
if [[ $cur == @(*/|[.~])* ]]; then
- _filedir '@(?(k)o?(.[gx]z|.zst))'
+ _filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
else
_modules $version
fi
--- a/completions/modprobe
+++ b/completions/modprobe 2021-10-04 13:36:14.743080796 +0000
@@ -80,7 +80,7 @@ _modprobe()
insert)
# do filename completion if we're giving a path to a module
if [[ $cur == @(*/|[.~])* ]]; then
- _filedir '@(?(k)o?(.[gx]z|.zst))'
+ _filedir '@(?(k)o?(.[gx]z|.zst|.bz2))'
elif [[ -n $module ]]; then
# do module parameter completion
if [[ $cur == *=* ]]; then

15
bsc1199724-modules.patch Normal file
View File

@ -0,0 +1,15 @@
---
bash_completion | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/bash_completion
+++ b/bash_completion 2022-05-23 10:50:43.197937832 +0000
@@ -1316,7 +1316,7 @@ _modules()
local modpath
modpath=/lib/modules/$1
COMPREPLY=($(compgen -W "$(command ls -RL $modpath 2>/dev/null |
- command sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p')" -- "$cur"))
+ command sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\|\.bz2\|\.zst\)\{0,1\}$/\1/p')" -- "$cur"))
}
# This function completes on installed modules

View File

@ -0,0 +1,17 @@
---
completions/curl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/completions/curl
+++ b/completions/curl
@@ -91,7 +91,9 @@ _curl()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help all")' -- "$cur"))
+ [[ $COMPREPLY ]] ||
+ COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
fi
} &&
complete -F _curl curl

View File

@ -0,0 +1,22 @@
---
bash_completion | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -2079,11 +2079,12 @@ _longopt()
# makeinfo and texi2dvi are defined elsewhere.
complete -F _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 md5sum mkdir mkfifo mknod \
+ grep grub head irb ld ldd less ln m4 md5sum mkdir mkfifo mknod \
mv nl nm objcopy objdump od paste pr ptx readelf rm rmdir \
sed sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \
texindex touch tr unexpand uniq vdir wc who
complete -F _longopt -o default env netstat seq uname units
+complete -F _longopt -o bashdefault -o default -o filenames -o nospace ls ll la l ls-l lf
declare -Ag _xspecs

38
qdbus-qt5.patch Normal file
View File

@ -0,0 +1,38 @@
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.11.orig/completions/qdbus
+++ bash-completion-2.11/completions/qdbus
@@ -9,6 +9,6 @@ _qdbus()
COMPREPLY=($(compgen -W '$(command ${words[@]} 2>/dev/null | \
command sed "s/(.*)//")' -- "$cur"))
} &&
- complete -F _qdbus qdbus dcop
+ complete -F _qdbus qdbus qdbus-qt5 dcop
# ex: filetype=sh
Index: bash-completion-2.11/completions/Makefile.am
===================================================================
--- bash-completion-2.11.orig/completions/Makefile.am
+++ bash-completion-2.11/completions/Makefile.am
@@ -680,6 +680,7 @@ CLEANFILES = \
pyvenv-3.6 \
pyvenv-3.7 \
pyvenv-3.8 \
+ qdbus-qt5 \
qemu-kvm \
qemu-system-i386 \
qemu-system-x86_64 \
@@ -894,7 +895,7 @@ symlinks: $(DATA)
$(ss) pyvenv \
pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8
$(ss) qdbus \
- dcop
+ dcop qdbus-qt5
$(ss) qemu \
qemu-kvm qemu-system-i386 qemu-system-x86_64
$(ss) quota \

View File

@ -0,0 +1,36 @@
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 | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -2034,8 +2034,19 @@ _complete_as_root()
_longopt()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local prev words cword split
+
+ if [[ "${cur:0:1}" == '$' ]] ; then
+ compopt -o dirnames +o filenames
+ else
+ compopt +o dirnames -o filenames
+ fi
+
+ if ! _init_completion -s ; then
+ _dollar $cur
+ return
+ fi
case "${prev,,}" in
--help | --usage | --version)

View File

@ -0,0 +1,28 @@
Bug boo#958462
Allow the smart bash builtin completion if normal completion scripting
does not return anything.
---
bash_completion | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: bash-completion-2.11/bash_completion
===================================================================
--- bash-completion-2.11.orig/bash_completion
+++ bash-completion-2.11/bash_completion
@@ -2096,11 +2096,13 @@ _longopt()
complete -F _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 m4 md5sum 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 sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \
texindex touch tr unexpand uniq vdir wc who
complete -F _longopt -o default env netstat seq uname units
complete -F _longopt -o bashdefault -o default -o filenames -o nospace ls ll la l ls-l lf
+complete -F _longopt -o bashdefault -o default -o filenames -o nospace rm rmdir
+
declare -Ag _xspecs

19
tar-completion.patch Normal file
View File

@ -0,0 +1,19 @@
boo#1012212 -- bash tab-autocompletion hangs on TAR-archiving with --create key
---
completions/tar | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: bash-completion-2.11/completions/tar
===================================================================
--- bash-completion-2.11.orig/completions/tar
+++ bash-completion-2.11/completions/tar
@@ -185,7 +185,7 @@ __tar_preparse_cmdline()
first_arg=1
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