From 9cfaa4936f4f1f04ac68d35a38b5fd7a108f876f Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 11 Dec 2014 12:42:28 -0500 Subject: [PATCH] rust: be even more carful while probing --- recipes/rust/rust.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 39c383d..3cbbc02 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -272,13 +272,15 @@ do_configure () { # where we're reinstalling the compiler. May want to try for a real # path based on bitbake vars # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. - local_rustc=$(which rustc) local_maybe_enable=disable local_rust_root=/not/set/do/not/use - if [ -n "$local_rustc" ]; then - local_rust_root=$(dirname $(dirname $local_rustc)) - if [ -e "$local_rust_root/bin/rustc" ]; then - local_maybe_enable=enable + if which rustc >/dev/null 2>&1; then + local_rustc=$(which rustc) + if [ -n "$local_rustc" ]; then + local_rust_root=$(dirname $(dirname $local_rustc)) + if [ -e "$local_rust_root/bin/rustc" ]; then + local_maybe_enable=enable + fi fi fi