From: EdĂȘnis Freindorfer Azevedo Date: Mon, 28 Jun 2021 17:25:25 +0000 (-0300) Subject: Create rules to add/remove symlinks for bash completion. X-Git-Tag: lxc-5.0.0~113^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d552285950ff2757ce52dba2cd2093ee330d757;p=thirdparty%2Flxc.git Create rules to add/remove symlinks for bash completion. By default, there is no out-of-the-box bash completion for lxc tools. This is due to dynamic loading of completions, that requires the completion filename to be the same as the command (e.g. `lxc-start` expects a completion filename `lxc-start`). But all commands are in file `lxc`, which is not read. Signed-off-by: Edenis Freindorfer Azevedo --- diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index da6806f87..eeaa3d69d 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -1982,11 +1982,24 @@ install-exec-local: install-libLTLIBRARIES if ENABLE_COMMANDS install-exec-hook: chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic +if ENABLE_BASH +install-data-local: + cd $(DESTDIR)$(bashcompdir); \ + for bin in $(bin_PROGRAMS) ; do \ + ln -sf lxc $$bin ; \ + done +endif endif uninstall-local: $(RM) $(DESTDIR)$(libdir)/liblxc.so* $(RM) $(DESTDIR)$(libdir)/liblxc.a +if ENABLE_BASH + for bin in $(bin_PROGRAMS) ; do \ + $(RM) $(DESTDIR)$(bashcompdir)/$$bin ; \ + done +endif + if ENABLE_PAM if HAVE_PAM $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*