Bug#804492: devscripts: bash completion broken after move to new directory

Nicholas Bamber nicholas at periapt.co.uk
Sun Nov 8 23:03:24 UTC 2015


Package: devscripts
Version: 2.15.9
Severity: important

Dear Maintainer,

I was trying to understand the bash completion code. I found that now that 
the devscripts bash completions don't work. For example

chdist<TAB>

should produce

nicholas at chilcott:~$ chdist 
apt-cache             compare-bin-packages  create                src2bin
apt-get               compare-bin-versions  grep-dctrl-packages   
apt-rdepends          compare-packages      grep-dctrl-sources    
bin2src               compare-versions      list                  

but instead just shows whatever files are in the current directory.

I found really three issues:

1. Firstly the scripts are now in the directory /usr/share/bash-completion/completions .
The scripts in this directory are autoloaded and expected to work slightly differently.
So this must be named with the name of the command they are providing a completion for.
So the following links are required:

ln -s devscripts.chdist chdist
ln -s devscripts.dcut dcut
ln -s devscripts.debchange debchange
ln -s devscripts.debchange dch
ln -s devscripts.debsign debsign
ln -s devscripts.mk-origtargz mk-origtargz
for i in wnpp-alert wnpp-check mk-build-deps rmadison mass-bug debsnap dd-list build-rdeps who-uploads transition-check getbuildlog dcontrol grep-excuses rc-alert bts whodepends dget pts-subscribe debc pts-unsubscribe
do
	ln -s devscripts.pkgnames $i
done
ln -s devscripts.uscan uscan
ln -s devscripts.uupdate uupdate

2. Some of the scripts (chdist  dch  dcut  debsign  uupdate) use a deprecated "have" mechanism.
To preserve name space purity this is replaced by "_have". That notwithstanding it does not seem
to work. A typical case is uupdate:

nicholas at chilcott:/usr/share/bash-completion/completions$ diff uupdate.old uupdate
1d0
< have uupdate &&
32c31
< [ "$have" ] && complete -F _uupdate -o filenames uupdate
---
> complete -F _uupdate -o filenames uupdate


3. The chdist script seems to have an additional issue.

nicholas at chilcott:/usr/share/bash-completion/completions$ diff chdist.old chdist
1d0
< have chdist &&
50c49
< [ -n "${have:-}" ] && complete -F _chdist $filenames chdist
---
> complete -F _chdist chdist

I am not quite sure where "$filenames" comes from. As far as I can see from git
it has always been there, but it is not as far as I can see defined. It might be intended
to be "-o filenames" as with other completions though I do not really think
that makes sense.

-- Package-specific info:

--- /etc/devscripts.conf ---

--- ~/.devscripts ---
export DEBCHECKOUT_USER='Nicholas Bamber (Periapt) <nicholas at periapt.co.uk>'
export DEBFULLNAME='Nicholas Bamber'
export DEBEMAIL='nicholas at periapt.co.uk'

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

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

Versions of packages devscripts depends on:
ii  dpkg-dev     1.18.3
ii  libc6        2.19-22
ii  perl         5.20.2-6
ii  python3      3.4.3-7
pn  python3:any  <none>

Versions of packages devscripts recommends:
ii  at                          3.1.16-1
ii  dctrl-tools                 2.24-1
ii  debian-keyring              2015.08.13
ii  dput                        0.9.6.4
ii  equivs                      2.0.9+nmu1
ii  fakeroot                    1.20.2-1
ii  file                        1:5.25-2
ii  gnupg                       1.4.19-6
ii  libdistro-info-perl         0.14
ii  libencode-locale-perl       1.05-1
ii  libjson-perl                2.90-1
ii  liblwp-protocol-https-perl  6.06-2
ii  libsoap-lite-perl           1.19-1
ii  liburi-perl                 1.69-1
ii  libwww-perl                 6.13-1
ii  lintian                     2.5.38
ii  man-db                      2.7.5-1
ii  patch                       2.7.5-1
ii  patchutils                  0.3.4-1
ii  python3-debian              0.1.27
ii  python3-magic               1:5.25-2
ii  sensible-utils              0.0.9
ii  strace                      4.10-3
ii  unzip                       6.0-19
ii  wdiff                       1.2.2-1
ii  wget                        1.16.3-3
ii  xz-utils                    5.1.1alpha+20120614-2.1

Versions of packages devscripts suggests:
ii  bsd-mailx [mailx]            8.1.2-0.20150408cvs-1
ii  build-essential              12.1
pn  cvs-buildpackage             <none>
pn  debbindiff                   <none>
pn  devscripts-el                <none>
pn  gnuplot                      <none>
ii  gpgv                         1.4.19-6
ii  libauthen-sasl-perl          2.1600-1
pn  libfile-desktopentry-perl    <none>
ii  libnet-smtp-ssl-perl         1.03-1
pn  libterm-size-perl            <none>
ii  libtimedate-perl             2.3000-2
pn  libyaml-syck-perl            <none>
ii  mutt                         1.5.24-1
ii  openssh-client [ssh-client]  1:6.9p1-2+b1
pn  svn-buildpackage             <none>
ii  w3m                          0.5.3-25+b1

-- no debconf information



More information about the devscripts-devel mailing list