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.
This commit is contained in:
Will Newton
2017-10-03 15:28:26 +01:00
committed by Doug Goldstein
parent a1cd215131
commit 7f80e6d68b
+11 -6
View File
@@ -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"