[oe-commits] Fabien Proriol : populate_sdk_base: allow SDK path of various level

git at git.openembedded.org git at git.openembedded.org
Sat Oct 27 08:48:16 UTC 2012


Module: openembedded-core.git
Branch: master-next
Commit: 7aee4e9438755c230e1399bd5226d6c8e7fcca31
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7aee4e9438755c230e1399bd5226d6c8e7fcca31

Author: Fabien Proriol <Fabien.Proriol at jdsu.com>
Date:   Tue Oct 16 14:32:30 2012 +0000

populate_sdk_base: allow SDK path of various level

In the previous version, tar extraction use the --strip-component
option with "4" hard coded value.
If we set another SDKPATH, with a different depth, the sdk installation
fails.

This patch computes the level from the SDKPATH value.

Signed-off-by: Fabien Proriol <fabien.proriol at jdsu.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/populate_sdk_base.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 2fe7f15..a3ac757 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -119,6 +119,7 @@ fakeroot create_shar() {
 #!/bin/bash
 
 DEFAULT_INSTALL_DIR="${SDKPATH}"
+COMPONENTS_LEN=$(echo ".${SDKPATH}" | sed "s/\// /g" | wc -w)
 
 printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
 read target_sdk_dir
@@ -155,7 +156,7 @@ fi
 payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
 
 printf "Extracting SDK..."
-tail -n +$payload_offset $0| tar xj --strip-components=4 -C $target_sdk_dir
+tail -n +$payload_offset $0| tar xj --strip-components=$COMPONENTS_LEN -C $target_sdk_dir
 echo "done"
 
 printf "Setting it up..."





More information about the Openembedded-commits mailing list