All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SDK: allow SDK path of various level
@ 2012-10-16 13:37 Fabien Proriol
  2012-10-16 14:21   ` Denys Dmytriyenko
  0 siblings, 1 reply; 5+ messages in thread
From: Fabien Proriol @ 2012-10-16 13:37 UTC (permalink / raw)
  To: openembedded-devel@lists.openembedded.org; +Cc: Fabien Proriol

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@jdsu.com>
---
 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 6eb6726..971adfc 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -117,6 +117,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
@@ -153,7 +154,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..."
-- 
1.7.8.6



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-16 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-16 13:37 [PATCH] SDK: allow SDK path of various level Fabien Proriol
2012-10-16 14:21 ` [oe] " Denys Dmytriyenko
2012-10-16 14:21   ` Denys Dmytriyenko
2012-10-16 14:42   ` [oe] " Fabien Proriol
2012-10-16 14:42     ` Fabien Proriol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.