[Bash-completion-devel] Bug#776160: bash-completion: /etc/profile.d/bash_completion causes warnings with '-o nounset'

Michael Gold michael at bitplane.org
Sat Jan 24 18:43:49 UTC 2015


Package: bash-completion
Version: 1:2.1-4
Tags: patch

/etc/profile.d/bash_completion accesses some variables like $BASH and
$PS1 that may be unset, which will produce a warning or error if the
(POSIX-standard) 'nounset' option is enabled.  See #776154 for details.
E.g.,
	$ set -u
	$ . /etc/profile.d/bash_completion.sh
	bash: BASH_COMPLETION_COMPAT_DIR: unbound variable

A patch is attached, which prevents errors when not loading completions
(i.e. in non-bash shells; but some of the completion scripts use unbound
variables).  I also quoted bmajor and bminor to guard against weird IFS
values.

- Michael


-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages bash-completion depends on:
ii  bash  4.3-11+b1
ii  dpkg  1.17.22

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bash_completion-nounset.diff
Type: text/x-diff
Size: 848 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20150124/e8e3ce95/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20150124/e8e3ce95/attachment.sig>


More information about the Bash-completion-devel mailing list