Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't define BASH_COMPLETION_COMPAT_DIR
If set, use it, but don't define. Also, the reason for making it read
only is not obvious to me nor could I find the rationale documented
anywhere. So as a side effect this gets rid of issues caused by its read
onlyness, e.g. Debian #857235.
  • Loading branch information
scop committed May 3, 2017
1 parent bf838e9 commit c41a762
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bash_completion
Expand Up @@ -37,11 +37,6 @@ else
set +v
fi

# Set the following to the location of the backwards compat completion dir.
#
: ${BASH_COMPLETION_COMPAT_DIR:=/etc/bash_completion.d}
readonly BASH_COMPLETION_COMPAT_DIR

# Blacklisted completions, causing problems with our code.
#
_blacklist_glob='@(acroread.sh)'
Expand Down Expand Up @@ -2075,14 +2070,14 @@ _xfunc()
}

# source compat completion directory definitions
if [[ -d $BASH_COMPLETION_COMPAT_DIR && -r $BASH_COMPLETION_COMPAT_DIR && \
-x $BASH_COMPLETION_COMPAT_DIR ]]; then
for i in "$BASH_COMPLETION_COMPAT_DIR"/*; do
compat_dir=${BASH_COMPLETION_COMPAT_DIR:-/etc/bash_completion.d}
if [[ -d $compat_dir && -r $compat_dir && -x $compat_dir ]]; then
for i in "$compat_dir"/*; do
[[ ${i##*/} != @($_backup_glob|Makefile*|$_blacklist_glob) \
&& -f $i && -r $i ]] && . "$i"
done
fi
unset i _blacklist_glob
unset compat_dir i _blacklist_glob

# source user completion file
[[ ${BASH_SOURCE[0]} != ~/.bash_completion && -r ~/.bash_completion ]] \
Expand Down
6 changes: 6 additions & 0 deletions doc/bash_completion.txt
Expand Up @@ -18,6 +18,12 @@ Configuration files
Environment variables
---------------------

*BASH_COMPLETION_COMPAT_DIR*::
Directory for pre-dynamic loading era (pre-2.0) backwards compatibility
completion files that are loaded eagerly from `bash_completion` when it is
loaded. If unset or null, the default compatibility directory to use is
`/etc/bash_completion.d`.

*COMP_CONFIGURE_HINTS*::
If set and not null, `configure` completion will return the entire option
string (e.g. `--this-option=DESCRIPTION`) so one can see what kind of data
Expand Down

0 comments on commit c41a762

Please sign in to comment.