toolchain-shar-extract.sh: improve behaviour when xz is not installed

Currently if xz isn't installed when installing the SDK you get an error
from tar and then the SDK installation continues, cascading into a load
of other failures since files are missing. Add a check to see if xz can
be run and error out if it can't, and also exit if tar fails.

(From OE-Core rev: 176e2bddb45b417b0bfbcdcd95bd5e81505e1e5b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2016-01-23 00:59:55 +13:00 committed by Richard Purdie
parent 979c8fbec4
commit 204e4abbcd
1 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,11 @@ if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
fi
fi
if ! xz -V > /dev/null 2>&1; then
echo "Error: xz is required for installation of this SDK, please install it first"
exit 1
fi
DEFAULT_INSTALL_DIR="@SDKPATH@"
SUDO_EXEC=""
target_sdk_dir=""
@ -168,7 +173,7 @@ fi
payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
printf "Extracting SDK..."
tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500
tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 || exit 1
echo "done"
printf "Setting it up..."