summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Tollerton <rich.tollerton@ni.com>2014-11-05 15:06:16 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-09 10:17:06 +0000
commit0870d9115546ad3b456af52ed45e46e637874a48 (patch)
treefe13be46abc85d40c0f997ed8c32962b60ec6204 /meta
parentc7eca550b0c11c040440ee2610c5eb1e78ed5be4 (diff)
downloadopenembedded-core-0870d9115546ad3b456af52ed45e46e637874a48.tar.gz
openembedded-core-0870d9115546ad3b456af52ed45e46e637874a48.tar.bz2
openembedded-core-0870d9115546ad3b456af52ed45e46e637874a48.zip
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. Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/files/toolchain-shar-template.sh5
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
echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
exit 1
fi
-executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111 -printf "'%h/%f' ")
+executable_files=$($SUDO_EXEC find $native_sysroot -type f \
+ \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ")
tdir=`mktemp -d`
if [ x$tdir = x ] ; then
@@ -162,7 +163,7 @@ done
# find out all perl scripts in $native_sysroot and modify them replacing the
# host perl with SDK perl.
-for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep "^#!.*perl" -l '{}' \;); do
+for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep -l "^#!.*perl" '{}' \;); do
$SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \
"s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script
done