[Bash-completion-devel] Bug#814599: bash-completion: different behavior in /etc/bash_completion.d/ than in /usr/share/bash-completion/completions/

Martin-Éric Racine martin-eric.racine at iki.fi
Sat Feb 13 11:57:54 UTC 2016


Package: bash-completion
Version: 1:2.1-4.2
Severity: important

Responding to Lintian's warning (package-installs-into-obsolete-dir etc/bash_completion.d) I moved a completion script to the new /usr/share/bash-completion/completions/ location. The script is not sourced at all. However, if I move it back to the old location, it is instantly available again.

The completion script involved:

8X-----
_chlogin()
{
	local cur files
	[ -r /srv/chroot/ ] || return 0
	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	files=$( ls --color=never /srv/chroot )
	if [ $COMP_CWORD -eq 1 ]
	then
		COMPREPLY=( $( compgen -W "$files" -- "$cur" ) )
        fi
        return 0
} &&
complete -F _chlogin chlogin
8X-----

The Bash configuration fragment used to enable bash-completion:

8X-----
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
8X-----


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (800, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages bash-completion depends on:
ii  bash  4.3-14+b1
ii  dpkg  1.18.4

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information



More information about the Bash-completion-devel mailing list