Path correction for the bash and zsh completion. With this fix the
completion can be used as usual.

Signed-off-by: Michael Haener <[email protected]>
---
 recipes-bsp/efibootguard/efibootguard_0.10.bb | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/recipes-bsp/efibootguard/efibootguard_0.10.bb 
b/recipes-bsp/efibootguard/efibootguard_0.10.bb
index 45a67c5..a21abe4 100644
--- a/recipes-bsp/efibootguard/efibootguard_0.10.bb
+++ b/recipes-bsp/efibootguard/efibootguard_0.10.bb
@@ -34,12 +34,12 @@ EXTRA_OECONF = "--with-gnuefi-sys-dir=${STAGING_DIR_HOST} \
                 --with-gnuefi-lib-dir=${STAGING_LIBDIR}"
 
 FILES_${PN}-tools-bash-completion = " \
-    ${datadir}/${BPN}/completion/bash \
+    ${datadir}/bash-completion \
 "
 RDEPENDS_${PN}-tools-bash-completion = "bash-completion"
 
 FILES_${PN}-tools-zsh-completion = " \
-    ${datadir}/${BPN}/completion/zsh \
+    ${datadir}/zsh/site-functions \
 "
 
 FILES:${PN}-tools = " \
@@ -75,6 +75,24 @@ do_install:class-native () {
        ln -s bg_setenv ${D}${bindir}/bg_printenv
 }
 
+do_install:append() {
+    # Fix bash-completion path
+    if [ -d ${D}/${datadir}/${BPN}/completion/bash ]; then
+        install -d ${D}/${datadir}/bash-completion/completions
+        mv ${D}/${datadir}/${BPN}/completion/bash/bg_printenv.bash 
${D}/${datadir}/bash-completion/completions/bg_printenv
+        mv ${D}/${datadir}/${BPN}/completion/bash/bg_setenv.bash 
${D}/${datadir}/bash-completion/completions/bg_setenv
+        rm -rf ${D}/${datadir}/${BPN}/completion/bash
+    fi
+
+    # Fix zsh-completion path
+    if [ -d ${D}/${datadir}/${BPN}/completion/zsh ]; then
+        install -d ${D}/${datadir}/zsh/site-functions
+        mv ${D}/${datadir}/${BPN}/completion/zsh/_bg_printenv 
${D}/${datadir}/zsh/site-functions/_bg_printenv
+        mv ${D}/${datadir}/${BPN}/completion/zsh/_bg_setenv 
${D}/${datadir}/zsh/site-functions/_bg_setenv
+        rm -rf ${D}/${datadir}/${BPN}/completion/zsh
+    fi
+}
+
 do_deploy:class-native () {
 }
 
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20220309190346.2660435-2-michael.haener%40siemens.com.

Reply via email to