On 27 Dec 2018, Gabriel F. T. Gomes wrote:

>I just found that the previous version of ifupdown2 used to ship a
>completion file for ifup (I built it from the .dsc file):
>
>  dpkg-deb --contents 
> /var/cache/pbuilder/result/ifupdown2_1.0~git20170314-1_all.deb | grep compl
>  drwxr-xr-x root/root         0 2017-03-14 19:06 ./usr/share/bash-completion/
>  drwxr-xr-x root/root         0 2017-03-14 19:06 
> ./usr/share/bash-completion/completions/
>  -rw-r--r-- root/root       383 2017-03-14 19:06 
> ./usr/share/bash-completion/completions/ifup
>
>So, maybe, this has something to do with the problem...  I'll try to
>reproduce it by installing the older version of ifupdown2.

That is the problem, indeed.

Here are the steps to reproduce it:

1. Install ifupdown2 version (ifupdown2_1.0~git20170314-1_all.deb)

  # dpkg -i ifupdown2_1.0~git20170314-1_all.deb

2. Check that it installs files under /usr/share/bash-completion

  # dpkg --search /usr/share/bash-completion/completions/ifup
  diversion by ifupdown2 from: /usr/share/bash-completion/completions/ifup
  diversion by ifupdown2 to: 
/usr/share/bash-completion/completions/ifup.disabled
  ifupdown2, bash-completion: /usr/share/bash-completion/completions/ifup

3. See that ifup is actually there:

  # ls /usr/share/bash-completion/completions/ifup
  /usr/share/bash-completion/completions/ifup

4. Upgrade ifupdown2:

  # aptitude upgrade ifupdown2

5. Repeat steps 2 and 3 (then see that the file is missing):

  # dpkg --search /usr/share/bash-completion/completions/ifup
  diversion by ifupdown2 from: /usr/share/bash-completion/completions/ifup
  diversion by ifupdown2 to: 
/usr/share/bash-completion/completions/ifup.disabled
  bash-completion: /usr/share/bash-completion/completions/ifup

  # ls /usr/share/bash-completion/completions/ifup
  ls: cannot access '/usr/share/bash-completion/completions/ifup': No such file 
or directory

This probably means that this is a problem with ifupdown2, rather than
with bash-completion, and, to the best of my knowledge, there's nothing
that bash-completion can do to fix this.  Maybe we should reassign this
bug against ifupdown2.

Shirish,

On the other hand, I found a way to workaround the bug for you.  You
have to purge the older version of ifupdown2 (2_1.0~git20170314-1),
before installing the newest.  I did all the steps below, and it fixed
the problem for me.

# aptitude purge ifupdown2
# dpkg -i ifupdown2_1.0~git20170314-1_all.deb
# aptitude purge ifupdown2
# aptitude install ifupdown2
# aptitude reinstall bash-completion
# ls /usr/share/bash-completion/completions/ifup
/usr/share/bash-completion/completions/ifup
# adequate bash-completion
bash-completion: py-file-not-bytecompiled 
/usr/share/bash-completion/completions/btdownloadheadless.py
bash-completion: py-file-not-bytecompiled 
/usr/share/bash-completion/completions/asciidoc.py
bash-completion: py-file-not-bytecompiled 
/usr/share/bash-completion/completions/btdownloadcurses.py
bash-completion: py-file-not-bytecompiled 
/usr/share/bash-completion/completions/btdownloadgui.py

It still complains about the non-compiled files, but this is a
different problem.

Cheers,
Gabriel

Reply via email to