From 4ed466a05145c4859d315179e4905f78ded2db42 Mon Sep 17 00:00:00 2001 From: Alexpux Date: Fri, 11 Apr 2014 13:46:04 +0400 Subject: [PATCH] bash-completion: Add some patches. --- bash-completion/PKGBUILD | 21 ++++++++++++--- bash-completion/bash-4.3.patch | 27 +++++++++++++++++++ bash-completion/bash-completion-lz4.patch | 10 +++++++ .../words_bad_array_subscript.patch | 13 +++++++++ 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 bash-completion/bash-4.3.patch create mode 100644 bash-completion/bash-completion-lz4.patch create mode 100644 bash-completion/words_bad_array_subscript.patch diff --git a/bash-completion/PKGBUILD b/bash-completion/PKGBUILD index 9f3b1eae..bf84c492 100644 --- a/bash-completion/PKGBUILD +++ b/bash-completion/PKGBUILD @@ -2,7 +2,7 @@ pkgname=bash-completion pkgver=2.1 -pkgrel=1 +pkgrel=2 pkgdesc="Programmable completion for the bash shell" arch=('any') url="http://bash-completion.alioth.debian.org/" @@ -10,8 +10,23 @@ license=('GPL') groups=('base') depends=('bash') options=('!emptydirs' '!makeflags') -source=(http://bash-completion.alioth.debian.org/files/${pkgname}-${pkgver}.tar.bz2) -md5sums=('4e2a9f11a4042a38ee79ddcd048e8b9e') +source=(http://bash-completion.alioth.debian.org/files/${pkgname}-${pkgver}.tar.bz2 + bash-4.3.patch + bash-completion-lz4.patch + words_bad_array_subscript.patch) +md5sums=('4e2a9f11a4042a38ee79ddcd048e8b9e' + 'f964553680d88a89dbe8a7275e94bd3b' + '54a801a7a2b7aaae6ad7b3b6419003fe' + 'f524a2d082fe5f799ab262c91a0cd507') + +prepare() { + cd ${pkgname}-${pkgver} + patch -p1 -i ${srcdir}/bash-4.3.patch + #patch -p0 -i ${srcdir}/bash-completion-lz4.patch + patch -p1 -i ${srcdir}/words_bad_array_subscript.patch + + autoreconf --install +} build() { cd ${pkgname}-${pkgver} diff --git a/bash-completion/bash-4.3.patch b/bash-completion/bash-4.3.patch new file mode 100644 index 00000000..09aa0106 --- /dev/null +++ b/bash-completion/bash-4.3.patch @@ -0,0 +1,27 @@ +--- a/bash_completion 2014-03-09 17:38:14 +0000 ++++ b/bash_completion 2014-03-13 23:26:44 +0000 +@@ -536,13 +536,23 @@ + # @param $2 Name of variable to return result to + _quote_readline_by_ref() + { +- if [[ $1 == \'* ]]; then ++ if [ -z "$1" ]; then ++ # avoid quoting if empty ++ printf -v $2 %s "$1" ++ elif [[ $1 == \'* ]]; then + # Leave out first character + printf -v $2 %s "${1:1}" ++ elif [[ $1 == ~* ]]; then ++ # avoid escaping first ~ ++ printf -v $2 ~%q "${1:1}" + else + printf -v $2 %q "$1" + fi + ++ # Replace double escaping ( \\ ) by single ( \ ) ++ # This happens always when argument is already escaped at cmdline, ++ # and passed to this function as e.g.: file\ with\ spaces ++ [[ ${!2} == *\\* ]] && printf -v $2 %s "${1//\\\\/\\}" + # If result becomes quoted like this: $'string', re-evaluate in order to + # drop the additional quoting. See also: http://www.mail-archive.com/ + # bash-completion-devel@lists.alioth.debian.org/msg01942.html diff --git a/bash-completion/bash-completion-lz4.patch b/bash-completion/bash-completion-lz4.patch new file mode 100644 index 00000000..ebc9e11f --- /dev/null +++ b/bash-completion/bash-completion-lz4.patch @@ -0,0 +1,10 @@ +--- completions/Makefile.am.orig 2014-03-20 19:31:07.341541256 -0400 ++++ completions/Makefile.am 2014-03-20 19:31:33.357950340 -0400 +@@ -195,6 +195,7 @@ + luseradd \ + luserdel \ + lvm \ ++ lz4 \ + lzip \ + lzma \ + lzop \ diff --git a/bash-completion/words_bad_array_subscript.patch b/bash-completion/words_bad_array_subscript.patch new file mode 100644 index 00000000..8a3a9eba --- /dev/null +++ b/bash-completion/words_bad_array_subscript.patch @@ -0,0 +1,13 @@ +diff --git a/bash_completion b/bash_completion +index 66d36b1..ce469d0 100644 +--- a/bash_completion ++++ b/bash_completion +@@ -707,7 +707,7 @@ _init_completion() + fi + done + +- [[ $cword -eq 0 ]] && return 1 ++ [[ $cword -le 0 ]] && return 1 + prev=${words[cword-1]} + + [[ ${split-} ]] && _split_longopt && split=true