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 setup.py 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

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

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 https://wiki.ubuntu.com/SimpleSbuild 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 :
#2

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