From d17724b0eac76792a49e56213cba74e32edba48f Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Thu, 17 Jan 2019 17:49:05 +0800 Subject: testsdk: enhance extract sdk part 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 oe-core have add support of change SDK type to .zip, so correct the extract function. Signed-off-by: Changqing Li Signed-off-by: Joshua Watt --- lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/oeqa/sdkmingw/testsdk.py') diff --git a/lib/oeqa/sdkmingw/testsdk.py b/lib/oeqa/sdkmingw/testsdk.py index 85fe3c6..173cfd9 100644 --- a/lib/oeqa/sdkmingw/testsdk.py +++ b/lib/oeqa/sdkmingw/testsdk.py @@ -12,7 +12,7 @@ class TestSDKMinGW(TestSDK): """ Get the name of the SDK file """ - return d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz") + return d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}") def extract_sdk(self, tcname, sdk_dir, d): """ @@ -23,7 +23,14 @@ class TestSDKMinGW(TestSDK): try: # TODO: It would be nice to try and extract the SDK in Wine to make # sure it is well formed - subprocess.check_output(['tar', '-xf', tcname, '-C', sdk_dir]) + + # TODO: Extract SDK according to SDK_ARCHIVE_TYPE, need to change if + # oe-core support other types. + if d.getVar("SDK_ARCHIVE_TYPE") == "zip": + subprocess.check_output(['unzip', '-d', sdk_dir, tcname]) + else: + subprocess.check_output(['tar', '-xf', tcname, '-C', sdk_dir]) + except subprocess.CalledProcessError as e: bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8")) -- cgit v1.2.3-54-g00ecf