[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 314cc0f13a9c8001f73e52bc00c1b8183f9d701e
Ville Skyttä
ville.skytta at iki.fi
Sat Mar 6 12:30:36 UTC 2010
The following commit has been merged in the master branch:
commit 314cc0f13a9c8001f73e52bc00c1b8183f9d701e
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Jan 24 21:06:42 2010 +0200
Drop support for bash < 3.2.
diff --git a/README b/README
index 4ee9a4e..725678a 100644
--- a/README
+++ b/README
@@ -12,7 +12,7 @@ if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
-(if you happen to have *only* bash >= 3, see further if not)
+(if you happen to have *only* bash >= 3.2 installed, see further if not)
If you don't have the package readily available for your distribution, or
you simply don't want to do this, put the bash_completion file somewhere
@@ -98,36 +98,6 @@ function used by mutt completion, where the function calls itself
recursively. This seems to confuse bash and it issues spurious
warnings if 'nounset' is set.
-V.
-
-After upgrading to bash 3.1, you may notice that completing on certain
-commands now fails with a message something like this:
-
- sed: -e expression #1, char 20: unterminated `s' command
-
-The reason for this is that bash 3.1 contains the following,
-innocent-looking bug fix (from bash's CHANGES file):
-
- t. Fixed a bug that caused the expanded value of a $'...' string
- to be incorrectly re-quoted if it occurred within a
- double-quoted ${...} parameter expansion.
-
-Unfortunately, this also had the side effect of causing single quotes
-to be stripped from $'...' strings inside double-quoted command
-substitutions. Confused?
-
-Efforts have been made to work around this issue in the bash
-completion code as of the 20060301 release. All previous versions are
-vulnerable to the problem. However, it's possible that, even in the
-20060301 release and later, affected code remains.
-
-The issue has now been officially recognised as a regression in the
-bash 3.1 release and is fixed by official patch 11. If you encounter
-problems of this nature, please apply the patch below to your copy of
-bash:
-
- ftp://ftp.gnu.org/gnu/bash/bash-3.1-patches/bash31-011
-
FAQ
---
@@ -318,10 +288,10 @@ guidelines in mind:
start interpreters. Use lightweight programs such as grep(1), awk(1)
and sed(1).
-- Use the full power of bash >= 3. We no longer support earlier bash
+- Use the full power of bash >= 3.2. We no longer support earlier bash
versions, so you may as well use all the features of that version of
bash to optimise your code. However, be careful when using features
- added since bash 3.0, since not everyone will be able to use them. Be
+ added since bash 3.2, since not everyone will be able to use them. Be
ESPECIALLY careful of using features exclusive to 4.x, as many people
are still using 3.x.
diff --git a/TODO b/TODO
index 10cdf89..7a5afe5 100644
--- a/TODO
+++ b/TODO
@@ -2,8 +2,8 @@ bash completion needs to be rewritten from the ground up.
---------------------------------------------------------
bash completion really needs to be rewritten from the ground up, using all of
-the features available in bash 3.1 and without regard for compatibility with
-the 2.x line.
+the features available in bash 3.2+ and without regard for compatibility with
+earlier versions.
At that time, it should be split into multiple files for easier source
management. Whether or not it is actually installed on the destination
diff --git a/bash_completion b/bash_completion
index b008aa4..ea7bc95 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1,5 +1,5 @@
#
-# bash_completion - programmable completion functions for bash 3.x
+# bash_completion - programmable completion functions for bash 3.2+
#
# Copyright © 2006-2008, Ian Macdonald <ian at caliban.org>
# © 2009-2010, Bash Completion Maintainers
diff --git a/bash_completion.sh.in b/bash_completion.sh.in
index af6eb2c..bdddeee 100644
--- a/bash_completion.sh.in
+++ b/bash_completion.sh.in
@@ -2,9 +2,11 @@
[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
# Check for recent enough version of bash.
-bash=${BASH_VERSION%.*}; bmajor=${bash%.*}
-if [ $bmajor -ge 3 -a -r @sysconfdir@/bash_completion ]; then
- # Source completion code.
- . @sysconfdir@/bash_completion
+bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+if [ $bmajor -gt 3 ] || [ $bmajor -eq 3 -a $bminor -ge 2 ]; then
+ if [ -r @sysconfdir@/bash_completion ]; then
+ # Source completion code.
+ . @sysconfdir@/bash_completion
+ fi
fi
-unset bash bmajor
+unset bash bmajor bminor
--
bash-completion
More information about the Bash-completion-commits
mailing list