]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base: allow SDK path of various level
authorFabien Proriol <Fabien.Proriol@jdsu.com>
Tue, 16 Oct 2012 14:32:30 +0000 (14:32 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 27 Oct 2012 08:33:42 +0000 (09:33 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass

index 2fe7f15370d1d8d19adc635c420cc7a3bbcb4258..a3ac757b2386050e11e6034965e262b2999fdc57 100644 (file)
@@ -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..."