[oe-commits] [openembedded-core] 25/62: toolchain-shar-extract.sh: add option to list contents

git at git.openembedded.org git at git.openembedded.org
Wed Aug 17 09:36:42 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 1d3e874f191f011eb9d7b0e12e513433c126036e
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 11 16:45:05 2016 +1200

    toolchain-shar-extract.sh: add option to list contents
    
    Add a -l command-line option for SDK installers to get a list of files
    that will be extracted by the SDK - internally this just runs "tar tv"
    on the embedded tarball. This can be used to look at which files the SDK
    provides without actually installing it. The initial user of this is the
    extensible SDK build process which needs to know what binaries are going
    to be installed by the buildtools installer without installing it.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/files/toolchain-shar-extract.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 9279310..4345104 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -47,7 +47,8 @@ relocate=1
 savescripts=0
 verbose=0
 publish=0
-while getopts ":yd:npDRS" OPT; do
+listcontents=0
+while getopts ":yd:npDRSl" OPT; do
 	case $OPT in
 	y)
 		answer="Y"
@@ -72,6 +73,9 @@ while getopts ":yd:npDRS" OPT; do
 	S)
 		savescripts=1
 		;;
+	l)
+		listcontents=1
+		;;
 	*)
 		echo "Usage: $(basename $0) [-y] [-d <dir>]"
 		echo "  -y         Automatic yes to all prompts"
@@ -83,11 +87,18 @@ while getopts ":yd:npDRS" OPT; do
 		echo "  -S         Save relocation scripts"
 		echo "  -R         Do not relocate executables"
 		echo "  -D         use set -x to see what is going on"
+		echo "  -l         list files that will be extracted"
 		exit 1
 		;;
 	esac
 done
 
+payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
+if [ "$listcontents" = "1" ] ; then
+    tail -n +$payload_offset $0| tar tvJ || exit 1
+    exit
+fi
+
 titlestr="@SDK_TITLE@ installer version @SDK_VERSION@"
 printf "%s\n" "$titlestr"
 printf "%${#titlestr}s\n" | tr " " "="
@@ -187,8 +198,6 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the
 	$SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1
 fi
 
-payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
-
 printf "Extracting SDK..."
 tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
 echo "done"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list