diff options
author | Richard Tollerton <rich.tollerton@ni.com> | 2014-11-05 15:06:16 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-09 10:21:24 +0000 |
commit | fb4d7ece3b5e67bcab133e8d6f17d2257d04049e (patch) | |
tree | e8c79a2ae2ad4e21e9c7eefe1e7a5c48fc9f8d1a /meta/files/toolchain-shar-template.sh | |
parent | a899e13329edec151c7e1880d4e9d7560be3fdef (diff) | |
download | poky-fb4d7ece3b5e67bcab133e8d6f17d2257d04049e.tar.gz |
populate_sdk_base: improve POSIXLY_CORRECT compat
The install script is sometimes called under POSIXLY_CORRECT. This
requires two fixes be made:
1. `find -perm /0000` is a gnuism; replace with an equivalent boolean
expression using `-perm -0000`.
2. POSIX grep requires that all options be passed on the command line
before all files; otherwise, the options must be parsed as filenames.
(From OE-Core rev: 0870d9115546ad3b456af52ed45e46e637874a48)
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files/toolchain-shar-template.sh')
-rw-r--r-- | meta/files/toolchain-shar-template.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/files/toolchain-shar-template.sh b/meta/files/toolchain-shar-template.sh index 02035d4539..2578a34a2d 100644 --- a/meta/files/toolchain-shar-template.sh +++ b/meta/files/toolchain-shar-template.sh | |||
@@ -132,7 +132,8 @@ if [ "$dl_path" = "" ] ; then | |||
132 | echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!" | 132 | echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!" |
133 | exit 1 | 133 | exit 1 |
134 | fi | 134 | fi |
135 | executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111 -printf "'%h/%f' ") | 135 | executable_files=$($SUDO_EXEC find $native_sysroot -type f \ |
136 | \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ") | ||
136 | 137 | ||
137 | tdir=`mktemp -d` | 138 | tdir=`mktemp -d` |
138 | if [ x$tdir = x ] ; then | 139 | if [ x$tdir = x ] ; then |
@@ -162,7 +163,7 @@ done | |||
162 | 163 | ||
163 | # find out all perl scripts in $native_sysroot and modify them replacing the | 164 | # find out all perl scripts in $native_sysroot and modify them replacing the |
164 | # host perl with SDK perl. | 165 | # host perl with SDK perl. |
165 | for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep "^#!.*perl" -l '{}' \;); do | 166 | for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep -l "^#!.*perl" '{}' \;); do |
166 | $SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \ | 167 | $SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \ |
167 | "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script | 168 | "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script |
168 | done | 169 | done |