diff options
author | Changqing Li <changqing.li@windriver.com> | 2019-04-30 17:08:21 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-03 06:11:57 +0100 |
commit | 3418d1326ccd9253743acd3fc1ac5741125382c0 (patch) | |
tree | fc239d78a5c43035c53bec307c76f279a57610c2 /meta/files | |
parent | 8216015a85812a225563ac85149ecaf37678d2c6 (diff) | |
download | poky-3418d1326ccd9253743acd3fc1ac5741125382c0.tar.gz |
populate_sdk_base: provide options to set sdk type
Current sdk type is tar.xz, but for mingw sdk, since we
have symlink under the sdk folder, 7zip which used to
extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so add option for usr can select the sdk type.
Add override SDK_ARCHIVE_TYPE, default type is tar.xz, and also
support type zip. user want to use zip type can set SDK_ARCHIVE_TYPE
to zip.
(From OE-Core rev: 57a33048a89a422cfdc986d3489c67b2d297e1e7)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 156085b500..ccc4f4e1ac 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -113,7 +113,16 @@ done | |||
113 | 113 | ||
114 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) | 114 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) |
115 | if [ "$listcontents" = "1" ] ; then | 115 | if [ "$listcontents" = "1" ] ; then |
116 | tail -n +$payload_offset $0| tar tvJ || exit 1 | 116 | if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then |
117 | tail -n +$payload_offset $0 > sdk.zip | ||
118 | if unzip -l sdk.zip;then | ||
119 | rm sdk.zip | ||
120 | else | ||
121 | rm sdk.zip && exit 1 | ||
122 | fi | ||
123 | else | ||
124 | tail -n +$payload_offset $0| tar tvJ || exit 1 | ||
125 | fi | ||
117 | exit | 126 | exit |
118 | fi | 127 | fi |
119 | 128 | ||
@@ -232,7 +241,16 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the | |||
232 | fi | 241 | fi |
233 | 242 | ||
234 | printf "Extracting SDK..." | 243 | printf "Extracting SDK..." |
235 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 | 244 | if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then |
245 | tail -n +$payload_offset $0 > sdk.zip | ||
246 | if $SUDO_EXEC unzip $EXTRA_TAR_OPTIONS sdk.zip -d $target_sdk_dir;then | ||
247 | rm sdk.zip | ||
248 | else | ||
249 | rm sdk.zip && exit 1 | ||
250 | fi | ||
251 | else | ||
252 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 | ||
253 | fi | ||
236 | echo "done" | 254 | echo "done" |
237 | 255 | ||
238 | printf "Setting it up..." | 256 | printf "Setting it up..." |