diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-01-23 00:59:55 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-24 09:40:33 +0000 |
commit | 204e4abbcd6c7255828e704e249beed016fec1b9 (patch) | |
tree | 2411b79911c90e5c3f61224c9f571c8c78fec795 /meta/files | |
parent | 979c8fbec4674d79ce541aff0093df680003df5d (diff) | |
download | poky-204e4abbcd6c7255828e704e249beed016fec1b9.tar.gz |
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>
Diffstat (limited to 'meta/files')
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index b1ef4b7668..d844771de0 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -29,6 +29,11 @@ if [ "$INST_ARCH" != "$SDK_ARCH" ]; then | |||
29 | fi | 29 | fi |
30 | fi | 30 | fi |
31 | 31 | ||
32 | if ! xz -V > /dev/null 2>&1; then | ||
33 | echo "Error: xz is required for installation of this SDK, please install it first" | ||
34 | exit 1 | ||
35 | fi | ||
36 | |||
32 | DEFAULT_INSTALL_DIR="@SDKPATH@" | 37 | DEFAULT_INSTALL_DIR="@SDKPATH@" |
33 | SUDO_EXEC="" | 38 | SUDO_EXEC="" |
34 | target_sdk_dir="" | 39 | target_sdk_dir="" |
@@ -168,7 +173,7 @@ fi | |||
168 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) | 173 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) |
169 | 174 | ||
170 | printf "Extracting SDK..." | 175 | printf "Extracting SDK..." |
171 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 | 176 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 || exit 1 |
172 | echo "done" | 177 | echo "done" |
173 | 178 | ||
174 | printf "Setting it up..." | 179 | printf "Setting it up..." |