[Debconf-devel] Bug#425676: syntactically incorrect completion script

Trent Buck trentbuck at gmail.com
Wed May 23 08:33:30 UTC 2007


Package: debconf
Version: 1.5.13
Severity: normal
File: /etc/bash_completion.d/debconf
Tags: patch

>From the bash manual:

,----[ bash(1), Definitions ]
| name: A word consisting only of alphanumeric characters and
| underscores, and beginning with an alphabetic character or an
| underscore.  Also referred to as an identifier.
`----

,----[ bash(1), Shell Grammar, Shell Function Definitions ]
| Shell functions are declared as follows:
| 
| [ function ] name () compound-command [redirection]
`----

debconf-show is a valid binary name, but _debconf-show is NOT a valid
function name.  The hyphen should be changed to an underscore, or
omitted.  This causes the following error when /bin/sh is a symlink to
bash:

,----[ ~/.xsession-errors ]
| /etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
| /etc/gdm/PreSession/Default: running: /usr/bin/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "/var/lib/gdm/:0.Xservers" -h "" -l ":0" "twb"
| /etc/gdm/Xsession: Beginning session setup...
| /etc/bash_completion.d/debconf: line 10: `_debconf-show': not a valid identifier
`----

The following UNTESTED patch should fix the problem.

diff -ud -L /sudo::/etc/bash_completion.d/debconf -L /tmp/buffer-content-31994ziG /tmp/tramp.31994AtM /tmp/buffer-content-31994ziG
--- /sudo::/etc/bash_completion.d/debconf
+++ /tmp/buffer-content-31994ziG
@@ -1,5 +1,5 @@
 have debconf-show &&
-_debconf-show()
+_debconf_show()
 {
         local cur
 
@@ -8,5 +8,5 @@
         COMPREPLY=($( compgen -W '--listowners --listdbs --db=' -- $cur ) \
                         $( apt-cache pkgnames -- $cur ) )
 }
-complete -F _debconf-show debconf-show
+complete -F _debconf_show debconf-show
 

Diff finished.  Wed May 23 18:31:53 2007




More information about the Debconf-devel mailing list