From 7d552285950ff2757ce52dba2cd2093ee330d757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Mon, 28 Jun 2021 14:25:25 -0300 Subject: [PATCH] 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 --- src/lxc/Makefile.am | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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*