public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 06/10] classes/populate_sdk_ext: properly handle buildtools install failure
Date: Thu, 11 Aug 2016 16:45:03 +1200	[thread overview]
Message-ID: <1bebb41b4b45f46bfccf875de4560042123e874c.1470890478.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1470890478.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1470890478.git.paul.eggleton@linux.intel.com>

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>
---
 meta/classes/populate_sdk_ext.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index a075a09..18013564 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.
-- 
2.5.5



  parent reply	other threads:[~2016-08-11  4:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11  4:44 [PATCH 00/10] Extensible SDK fixes Paul Eggleton
2016-08-11  4:44 ` [PATCH 01/10] gen-lockedsig-cache: ensure symlinks are dereferenced Paul Eggleton
2016-08-11  4:44 ` [PATCH 02/10] classes/populate_sdk_ext: ensure eSDK can build without uninative enabled Paul Eggleton
2016-08-11  4:45 ` [PATCH 03/10] classes/populate_sdk_ext: handle lack of uninative when filtering sstate Paul Eggleton
2016-08-11  4:45 ` [PATCH 04/10] classes/populate_sdk_ext: sstate filtering fixes Paul Eggleton
2016-08-11  4:45 ` [PATCH 05/10] lib/oe/copy_buildsystem: fix merging sstate directories for eSDK Paul Eggleton
2016-08-11  4:45 ` Paul Eggleton [this message]
2016-08-11  4:45 ` [PATCH 07/10] classes/populate_sdk_ext: properly determine buildtools filename Paul Eggleton
2016-08-11  4:45 ` [PATCH 08/10] toolchain-shar-extract.sh: add option to list contents Paul Eggleton
2016-08-11  4:45 ` [PATCH 09/10] classes/populate_sdk_ext: add some pre-install checks Paul Eggleton
2016-08-11 22:47   ` Paul Eggleton
2016-08-11  4:45 ` [PATCH 10/10] classes/populate_sdk_ext: drop duplicated error message Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bebb41b4b45f46bfccf875de4560042123e874c.1470890478.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox