Installing completions with ppa package

Asked by Benjamin Morledge-Hampton on 2020-11-25

I am having troubles installing completions scripts with packages posted to my ppa. I have been able to successfully use either dh_bash-completion or the data_files parameter in my file to install my completions file to the expected /usr/share/bash-completion/completions directory. When I build and install my package using debuild and dpkg on my local machine, the package installs properly and the completions script gets added to the aforementioned location. However, once the package builds on launchpad and I try to install it via apt, the completions script no longer gets installed at all, as far as I can tell.

Is there something I am missing about this process? Is there an easier way to get completions to install alongside a package? Also, it is interesting to me that installing completions in either of the ways that I have listed requires restarting the terminal before they take effect. This seems counterintuitive. Is there to install the completions and have them take effect immediately when installing a package through a ppa?

Thanks so much in advance for any help.

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Benjamin Morledge-Hampton
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :

Testing with debuild locally isn't a very reliable way to test, because it's extremely easy to miss build-dependencies or otherwise have an unclean build environment. We normally recommend people test with sbuild (see for setup advice), and indeed when I try that myself I can reproduce the same problem you had with nucperiod 0.4.3-0ubuntu1.

The problem you have is that debian/nucperiod.bash-completion in your source package is marked executable, which confuses dh_bash-completion because executable files mean something special (see "man debhelper"). "chmod -x debian/nucperiod.bash-completion" and it gets installed properly. While you're there, debian/changelog, debian/compat, debian/control, and debian/copyright should all ideally be non-executable as well, though those don't cause a problem at present.

We can't help you with your question about having completions take effect immediately, whether through a PPA or any other similar packaging mechanism. My guess is that you'd need to direct that completion to the bash-completion developers.

Revision history for this message
Benjamin Morledge-Hampton (ben-morledge-hampton) said :

Many thanks! This fixed it for me. Greatly appreciate the help.