summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-02 21:42:25 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-11 16:40:45 +1200
commit1bebb41b4b45f46bfccf875de4560042123e874c (patch)
tree7d52de579d9f7ca377bf20332dca08c2c969fb1c
parent303d3026c3bd97ad624ef6add479c67af6cb9213 (diff)
downloadopenembedded-core-contrib-1bebb41b4b45f46bfccf875de4560042123e874c.tar.gz
openembedded-core-contrib-1bebb41b4b45f46bfccf875de4560042123e874c.tar.bz2
openembedded-core-contrib-1bebb41b4b45f46bfccf875de4560042123e874c.zip
classes/populate_sdk_ext: properly handle buildtools install failure
If the buildtools installation failed, we were using a subshell instead of a compound command and thus the subshell exited but the script continued on, which is really not what we want to happen. Additionally log the buildtools installer output to a file and cat it if it fails so that you can actually see what went wrong, as well as amending the environment setup script to print a warning as we do when the preparation fails. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--meta/classes/populate_sdk_ext.bbclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index a075a0930a..180135645f 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -490,14 +490,16 @@ SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}"
sdk_ext_postinst() {
printf "\nExtracting buildtools...\n"
cd $target_sdk_dir
- printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null || ( printf 'ERROR: buildtools installation failed\n' ; exit 1 )
+ env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
+ 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 ; }
# Delete the buildtools tar file since it won't be used again
rm ./*buildtools-nativesdk-standalone*.sh -f
+ # We don't need the log either since it succeeded
+ rm -f buildtools.log
# Make sure when the user sets up the environment, they also get
# the buildtools-tarball tools in their path.
- env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script
# Allow bitbake environment setup to be ran as part of this sdk.