All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] populate_sdk_base: improve POSIXLY_CORRECT compat
@ 2014-11-05 21:06 Ben Shelton
  0 siblings, 0 replies; only message in thread
From: Ben Shelton @ 2014-11-05 21:06 UTC (permalink / raw
  To: openembedded-core

From: Richard Tollerton <rich.tollerton@ni.com>

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>
---
 meta/files/toolchain-shar-template.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/files/toolchain-shar-template.sh b/meta/files/toolchain-shar-template.sh
index 02035d4..2578a34 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
-- 
2.1.3



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-05 21:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 21:06 [PATCH] populate_sdk_base: improve POSIXLY_CORRECT compat Ben Shelton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.