diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-08-11 16:45:05 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:41 +0100 |
commit | cea1632471ca6671425ffc753246e6b8fea0d19d (patch) | |
tree | af858268b79bf7ffd0da2eaaab0320c512f39d85 /meta/files | |
parent | 7cd213d8a95e5534e0059399b5b2c21022b4138c (diff) | |
download | poky-cea1632471ca6671425ffc753246e6b8fea0d19d.tar.gz |
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.
(From OE-Core rev: 1d3e874f191f011eb9d7b0e12e513433c126036e)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 9279310376..434510470b 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh | |||
@@ -47,7 +47,8 @@ relocate=1 | |||
47 | savescripts=0 | 47 | savescripts=0 |
48 | verbose=0 | 48 | verbose=0 |
49 | publish=0 | 49 | publish=0 |
50 | while getopts ":yd:npDRS" OPT; do | 50 | listcontents=0 |
51 | while getopts ":yd:npDRSl" OPT; do | ||
51 | case $OPT in | 52 | case $OPT in |
52 | y) | 53 | y) |
53 | answer="Y" | 54 | answer="Y" |
@@ -72,6 +73,9 @@ while getopts ":yd:npDRS" OPT; do | |||
72 | S) | 73 | S) |
73 | savescripts=1 | 74 | savescripts=1 |
74 | ;; | 75 | ;; |
76 | l) | ||
77 | listcontents=1 | ||
78 | ;; | ||
75 | *) | 79 | *) |
76 | echo "Usage: $(basename $0) [-y] [-d <dir>]" | 80 | echo "Usage: $(basename $0) [-y] [-d <dir>]" |
77 | echo " -y Automatic yes to all prompts" | 81 | echo " -y Automatic yes to all prompts" |
@@ -83,11 +87,18 @@ while getopts ":yd:npDRS" OPT; do | |||
83 | echo " -S Save relocation scripts" | 87 | echo " -S Save relocation scripts" |
84 | echo " -R Do not relocate executables" | 88 | echo " -R Do not relocate executables" |
85 | echo " -D use set -x to see what is going on" | 89 | echo " -D use set -x to see what is going on" |
90 | echo " -l list files that will be extracted" | ||
86 | exit 1 | 91 | exit 1 |
87 | ;; | 92 | ;; |
88 | esac | 93 | esac |
89 | done | 94 | done |
90 | 95 | ||
96 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) | ||
97 | if [ "$listcontents" = "1" ] ; then | ||
98 | tail -n +$payload_offset $0| tar tvJ || exit 1 | ||
99 | exit | ||
100 | fi | ||
101 | |||
91 | titlestr="@SDK_TITLE@ installer version @SDK_VERSION@" | 102 | titlestr="@SDK_TITLE@ installer version @SDK_VERSION@" |
92 | printf "%s\n" "$titlestr" | 103 | printf "%s\n" "$titlestr" |
93 | printf "%${#titlestr}s\n" | tr " " "=" | 104 | 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 | |||
187 | $SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1 | 198 | $SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1 |
188 | fi | 199 | fi |
189 | 200 | ||
190 | payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) | ||
191 | |||
192 | printf "Extracting SDK..." | 201 | printf "Extracting SDK..." |
193 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 | 202 | tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 |
194 | echo "done" | 203 | echo "done" |