summaryrefslogtreecommitdiffstats
path: root/meta/files/toolchain-shar-extract.sh
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2019-04-30 17:08:21 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-02 13:45:57 +0100
commit57a33048a89a422cfdc986d3489c67b2d297e1e7 (patch)
tree6f6a131b66775e0bb6ed8de611d4c07d400e07af /meta/files/toolchain-shar-extract.sh
parent2ea676072d7edd06ef9e886827c0d61d574ca377 (diff)
downloadopenembedded-core-57a33048a89a422cfdc986d3489c67b2d297e1e7.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. Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files/toolchain-shar-extract.sh')
-rw-r--r--meta/files/toolchain-shar-extract.sh22
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
payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
if [ "$listcontents" = "1" ] ; then
- tail -n +$payload_offset $0| tar tvJ || exit 1
+ if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then
+ tail -n +$payload_offset $0 > sdk.zip
+ if unzip -l sdk.zip;then
+ rm sdk.zip
+ else
+ rm sdk.zip && exit 1
+ fi
+ else
+ tail -n +$payload_offset $0| tar tvJ || exit 1
+ fi
exit
fi
@@ -232,7 +241,16 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the
fi
printf "Extracting SDK..."
-tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
+if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then
+ tail -n +$payload_offset $0 > sdk.zip
+ if $SUDO_EXEC unzip $EXTRA_TAR_OPTIONS sdk.zip -d $target_sdk_dir;then
+ rm sdk.zip
+ else
+ rm sdk.zip && exit 1
+ fi
+else
+ tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
+fi
echo "done"
printf "Setting it up..."