summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonas Niilola <juippis@gentoo.org>2021-10-22 10:45:08 +0300
committerJoonas Niilola <juippis@gentoo.org>2021-10-22 11:39:11 +0300
commitbc9d9ec1d7cc6584b61762649259265f37b56885 (patch)
tree3d6a6f3c4b6796f9c3d72f33bb9a3e98d12e68af /app-emulation
parentapp-emulation/lxc: add 4.0.11 (diff)
downloadgentoo-bc9d9ec1d7cc6584b61762649259265f37b56885.tar.gz
gentoo-bc9d9ec1d7cc6584b61762649259265f37b56885.tar.bz2
gentoo-bc9d9ec1d7cc6584b61762649259265f37b56885.zip
app-emulation/lxc: rework bash-completion logic in 4.0.11
- since it collides with lxd's bash-completion file. Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/lxc/lxc-4.0.11.ebuild13
1 files changed, 10 insertions, 3 deletions
diff --git a/app-emulation/lxc/lxc-4.0.11.ebuild b/app-emulation/lxc/lxc-4.0.11.ebuild
index 4af531d3e74f..65cb5e5ee843 100644
--- a/app-emulation/lxc/lxc-4.0.11.ebuild
+++ b/app-emulation/lxc/lxc-4.0.11.ebuild
@@ -134,9 +134,16 @@ src_configure() {
src_install() {
default
- mkdir -p "${ED}"/$(get_bashcompdir) || die
- mv "${ED}"/etc/bash_completion.d/* "${ED}"/$(get_bashcompdir)/ || die
- rmdir "${ED}"/etc/bash_completion.d/ || die
+ # The main bash-completion file will collide with lxd, need to relocate and update symlinks.
+ mkdir -p "${ED}"/$(get_bashcompdir) || die "Failed to create bashcompdir."
+ mv "${ED}"/etc/bash_completion.d/lxc "${ED}"/$(get_bashcompdir)/lxc-start || die "Failed to relocate lxc bash-completion file."
+ rm -r "${ED}"/etc/bash_completion.d || die "Failed to remove wrong bash_completion.d content."
+
+ if use tools; then
+ bashcomp_alias lxc-start lxc-{attach,cgroup,copy,console,create,destroy,device,execute,freeze,info,monitor,snapshot,stop,unfreeze,wait}
+ else
+ bashcomp_alias lxc-start lxc-usernsexec
+ fi
keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
rmdir "${D}"/var/cache/lxc "${D}"/var/cache || die "rmdir failed"