summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-11 16:45:04 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:35:41 +0100
commit7cd213d8a95e5534e0059399b5b2c21022b4138c (patch)
tree3f1bba0f8ca9caeecf94dd4890dadf2e94f3c7a3 /meta
parent5895bb6d2c1cbc38872716ec2c03c56990cb164c (diff)
downloadpoky-7cd213d8a95e5534e0059399b5b2c21022b4138c.tar.gz
classes/populate_sdk_ext: properly determine buildtools filename
Determine the name of the current buildtools installer ahead of time, set it in a variable and use that variable rather than the wildcarded version everywhere, since it's much tidier. (From OE-Core rev: d5a601db41ba3c561aced7f5a38689f6b4c9a87c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass17
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 180135645f..2464acb68d 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -452,8 +452,12 @@ python copy_buildsystem () {
452 f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath))) 452 f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath)))
453} 453}
454 454
455def extsdk_get_buildtools_filename(d): 455def get_current_buildtools(d):
456 return '*-buildtools-nativesdk-standalone-*.sh' 456 """Get the file name of the current buildtools installer"""
457 import glob
458 btfiles = glob.glob(os.path.join(d.getVar('SDK_DEPLOY', True), '*-buildtools-nativesdk-standalone-*.sh'))
459 btfiles.sort(key=os.path.getctime)
460 return os.path.basename(btfiles[-1])
457 461
458install_tools() { 462install_tools() {
459 install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk} 463 install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
@@ -462,8 +466,7 @@ install_tools() {
462 touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase 466 touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
463 467
464 # find latest buildtools-tarball and install it 468 # find latest buildtools-tarball and install it
465 buildtools_path=`ls -t1 ${SDK_DEPLOY}/${@extsdk_get_buildtools_filename(d)} | head -n1` 469 install ${SDK_DEPLOY}/${SDK_BUILDTOOLS_INSTALLER} ${SDK_OUTPUT}/${SDKPATH}
466 install $buildtools_path ${SDK_OUTPUT}/${SDKPATH}
467 470
468 install -m 0644 ${COREBASE}/meta/files/ext-sdk-prepare.py ${SDK_OUTPUT}/${SDKPATH} 471 install -m 0644 ${COREBASE}/meta/files/ext-sdk-prepare.py ${SDK_OUTPUT}/${SDKPATH}
469} 472}
@@ -491,10 +494,10 @@ sdk_ext_postinst() {
491 printf "\nExtracting buildtools...\n" 494 printf "\nExtracting buildtools...\n"
492 cd $target_sdk_dir 495 cd $target_sdk_dir
493 env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" 496 env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
494 printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; } 497 printf "buildtools\ny" | ./${SDK_BUILDTOOLS_INSTALLER} > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
495 498
496 # Delete the buildtools tar file since it won't be used again 499 # Delete the buildtools tar file since it won't be used again
497 rm ./*buildtools-nativesdk-standalone*.sh -f 500 rm -f ./${SDK_BUILDTOOLS_INSTALLER}
498 # We don't need the log either since it succeeded 501 # We don't need the log either since it succeeded
499 rm -f buildtools.log 502 rm -f buildtools.log
500 503
@@ -538,6 +541,8 @@ fakeroot python do_populate_sdk_ext() {
538 bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH', True), d.getVar('BUILD_ARCH', True))) 541 bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH', True), d.getVar('BUILD_ARCH', True)))
539 542
540 d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d)) 543 d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
544 buildtools_fn = get_current_buildtools(d)
545 d.setVar('SDK_BUILDTOOLS_INSTALLER', buildtools_fn)
541 546
542 bb.build.exec_func("do_populate_sdk", d) 547 bb.build.exec_func("do_populate_sdk", d)
543} 548}