package: Remove shell completion at finalize stage
Instead of doing a removal of the completion file package per package,
do it all at the finalize stage so it's done once and for all.
Note: This fixes an issue with systemd where passing a --bashcompletiondir
or --zshcompletiondir would be evaluated to '.' by the autotools macro.
This would create a 'target./' directory.
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
diff --git a/Makefile b/Makefile
index 35818f0..daf692e 100644
--- a/Makefile
+++ b/Makefile
@@ -556,6 +556,12 @@
ifneq ($(BR2_PACKAGE_GDB),y)
rm -rf $(TARGET_DIR)/usr/share/gdb
endif
+ifneq ($(BR2_PACKAGE_BASH),y)
+ rm -rf $(TARGET_DIR)/usr/share/bash-completion
+endif
+ifneq ($(BR2_PACKAGE_ZSH),y)
+ rm -rf $(TARGET_DIR)/usr/share/zsh
+endif
rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc