Dr. Werner Fink 2014-11-17 12:50:19 +00:00 committed by Git OBS Bridge
parent ac4b5d4400
commit 849850232b
4 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,21 @@
---
bash_completion | 8 ++++++++
1 file changed, 8 insertions(+)
--- bash_completion
+++ bash_completion 2014-11-17 12:41:17.573518527 +0000
@@ -565,6 +565,14 @@ _filedir()
local -a toks
local quoted x tmp
+ if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)/ ]]; then
+ eval local dir="${cur%%/*}"
+ if [[ -d "$dir" ]]; then
+ cur="${dir}/${cur#*/}"
+ [[ "$1" != -d ]] && set -- -d $@
+ fi
+ fi
+
_quote_readline_by_ref "$cur" quoted
x=$( compgen -d -- "$quoted" ) &&
while read -r tmp; do

View File

@ -0,0 +1,25 @@
---
bash_completion.sh.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- bash_completion.sh.in
+++ bash_completion.sh.in 2014-11-17 12:17:01.505519084 +0000
@@ -1,9 +1,10 @@
# Check for interactive bash and that we haven't already been sourced.
-[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION_COMPAT_DIR" ] && return
+[ -z "$BASH_VERSION" ] && return
+[ -n "$BASH_COMPLETION_COMPAT_DIR" ] && return
+[[ $- =~ i ]] || return
# Check for recent enough version of bash.
-bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
-if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
+if [ ${BASH_VERSINFO[0]} -gt 4 ] || [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
@@ -11,4 +12,3 @@ if [ $bmajor -gt 4 ] || [ $bmajor -eq 4
. @pkgdatadir@/bash_completion
fi
fi
-unset bash bmajor bminor

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Nov 17 12:46:11 UTC 2014 - werner@suse.de
- Add patch PS1-completion-boo903362.patch to avoid trouble if
restricted characters of the shell are used in PS1 like
exclamation mark (boo#903362).
- Add patch FOO-dir-completion-boo905348.patch to expand variables
which value is actual a directory to avoid excaped dollar sign
(boo#905348).
------------------------------------------------------------------- -------------------------------------------------------------------
Mon May 13 07:08:49 UTC 2013 - werner@suse.de Mon May 13 07:08:49 UTC 2013 - werner@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package bash-completion # spec file for package bash-completion
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -29,6 +29,10 @@ Source1: bash-completion-rpmlintrc
Patch0: %{name}-%{version}.patch Patch0: %{name}-%{version}.patch
# PATCH-PATCH-EXTEND-OPENSUSE bnc#818365 -- bash completion for builtin command "pushd" is missing # PATCH-PATCH-EXTEND-OPENSUSE bnc#818365 -- bash completion for builtin command "pushd" is missing
Patch1: pushd-completion-bnc818365.patch Patch1: pushd-completion-bnc818365.patch
# PATCH-FIX-SUSE bnc#903362 -- tab completion for file names prints error
Patch2: PS1-completion-boo903362.patch
# PATCH-FIX-SUSE bnc#905348 -- tab completion with shell variable changes command line with backslash
Patch3: FOO-dir-completion-boo905348.patch
BuildRequires: pkg-config BuildRequires: pkg-config
Requires: bash Requires: bash
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -42,6 +46,8 @@ of the programmable completion feature of Bash 2.04 and later.
%setup -q %setup -q
%patch0 -b .p0 %patch0 -b .p0
%patch1 -b .p1 %patch1 -b .p1
%patch2 -b .p2
%patch3 -b .p3
%build %build
%configure %configure