[Bash-completion-devel] Bug#549550: [PATCH] bash-completion: Defined functions clash with user environment

Jari Aalto jari.aalto at cante.net
Sun Oct 4 10:33:34 UTC 2009


Package: bash-completion
Version: 1:1.0-3
Severity: important
Tags: patch


PROBLEM

By installing bash completion package, there are serious environment
clashes. The function in the package do not have distinct prefixes to
differentiate them from the user's aliases and functions; so
there will be an inevitable clash at some point.

It happened in my case: I have several those functions defined (quote,
dequote, have, _expand, _services, _alias, _export, _umount, _mount,
_man, _tar, _cvs, _rsync, _make, _cd, _screen) from years of use. The
choice of private functions/aliases to underscore(_) prefix was natural
in order to differentiate them from system commands.

RELATED

The Emacs packages have had exactly the same problems and solutions.
In Emacs, all the functions occupy the same global name space; just
like Bash aliases and functions do.

The make the packages unique, each one of them chose to use a unique
prefix. This can be seen e.g. in the Gnus newsreader package, which
uses prefix gnus-* for functions, and message.el that uses message-*
respectively. Likewise for all Emacs packages.

SUGGESTION

The problem can be solved by using a common prefix for all functions.
The provided git patches will convert everything to start with prefix:

    _bc_*  for "bash completion".

THE PATCHES

As there are about 360 individual patch sets, please merge in the
changes from repository:

    git remote add jaalto git://git.cante.net/dev/bash-completion
    git pull jaalto

Branch to merge:

    naming-changes-all

NOTES

I've done my best to make the correct replacements (all by hand; eye
balling; no scripts). As this is the starting point for the dev team,
please continue and correct any mistakes you see as needed.

I hope, the patches provide a good start to make the bash completion
package more robust to install.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash-completion depends on:
ii  bash                          4.0-4      The GNU Bourne Again SHell

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information





More information about the Bash-completion-devel mailing list