Package: bash
Version: 4.2+dfsg-0.1
Severity: minor

Dear Maintainer,

By default, bash ships with bash_completion
disabled in /etc/bash.bashrc,
enabled in /etc/skel/.bashrc

If, when, an administrator decides to uncomment (enable) bash_completion in
bash.bashrc,
the script runs twice for users with unmodified .bashrc.

If a test is added to /etc/skel/.bashrc, like so:
if [ ! $BASH_COMPLETION_COMPAT_DIR ]; then
    #... whole of bash_completion code
fi

The script doesn't run twice.

$ time [ ! $BASH_COMPLETION_COMPAT_DIR ] && . /etc/bash_completion

real    0m0.000s
user    0m0.000s
sys     0m0.000s

$ time . /etc/bash_completion

real    0m0.187s
user    0m0.092s
sys    0m0.024s

It's a sane proposed default.


-- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Versions of packages bash recommends:
ii  bash-completion  1:2.0-1

-- Configuration Files:
/etc/bash.bashrc changed [not included]

-- no debconf information

Reply via email to