From 7f80e6d68b48a0a2446a606dd35901db4505d61a Mon Sep 17 00:00:00 2001 From: Will Newton Date: Tue, 3 Oct 2017 15:28:26 +0100 Subject: [PATCH] cargo.bbclass: Avoid bashism in cargo_do_install The double square brackets are an extension to POSIX so are not available in some shells. Use a case statement instead. --- classes/cargo.bbclass | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 9bbc49d..b3a30f8 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -46,15 +46,20 @@ cargo_do_compile () { cargo_do_install () { local have_installed=false for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do - if [[ $tgt == *.so || $tgt == *.rlib ]]; then + case $tgt in + *.so|*.rlib) install -d "${D}${rustlibdir}" install -m755 "$tgt" "${D}${rustlibdir}" have_installed=true - elif [ -f "$tgt" ] && [ -x "$tgt" ]; then - install -d "${D}${bindir}" - install -m755 "$tgt" "${D}${bindir}" - have_installed=true - fi + ;; + *) + if [ -f "$tgt" ] && [ -x "$tgt" ]; then + install -d "${D}${bindir}" + install -m755 "$tgt" "${D}${bindir}" + have_installed=true + fi + ;; + esac done if ! $have_installed; then die "Did not find anything to install"