From 849850232b77a565a3243d7d97ecdc82b89d3053c755aad7b02e5a4769e4ad57 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 17 Nov 2014 12:50:19 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/shells/bash-completion?expand=0&rev=50 --- FOO-dir-completion-boo905348.patch | 21 +++++++++++++++++++++ PS1-completion-boo903362.patch | 25 +++++++++++++++++++++++++ bash-completion.changes | 10 ++++++++++ bash-completion.spec | 8 +++++++- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 FOO-dir-completion-boo905348.patch create mode 100644 PS1-completion-boo903362.patch diff --git a/FOO-dir-completion-boo905348.patch b/FOO-dir-completion-boo905348.patch new file mode 100644 index 0000000..6e8cabe --- /dev/null +++ b/FOO-dir-completion-boo905348.patch @@ -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 diff --git a/PS1-completion-boo903362.patch b/PS1-completion-boo903362.patch new file mode 100644 index 0000000..4341e73 --- /dev/null +++ b/PS1-completion-boo903362.patch @@ -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 diff --git a/bash-completion.changes b/bash-completion.changes index a0e3a83..d34cc5c 100644 --- a/bash-completion.changes +++ b/bash-completion.changes @@ -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 diff --git a/bash-completion.spec b/bash-completion.spec index 403d717..c142503 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -1,7 +1,7 @@ # # 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 # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,10 @@ Source1: bash-completion-rpmlintrc Patch0: %{name}-%{version}.patch # PATCH-PATCH-EXTEND-OPENSUSE bnc#818365 -- bash completion for builtin command "pushd" is missing 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 Requires: bash BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -42,6 +46,8 @@ of the programmable completion feature of Bash 2.04 and later. %setup -q %patch0 -b .p0 %patch1 -b .p1 +%patch2 -b .p2 +%patch3 -b .p3 %build %configure