[oe-commits] Richard Purdie : populate_sdk_base: Fix grep command usage on old hosts

git at git.openembedded.org git at git.openembedded.org
Tue Jul 29 08:59:03 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 7986adeac16550b33f65fded39a55f668e0e543f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7986adeac16550b33f65fded39a55f668e0e543f

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Mon Jul 28 17:55:05 2014 +0100

populate_sdk_base: Fix grep command usage on old hosts

"man grep" on centos:

       -R, -r, --recursive
              Read all files under each directory, recursively; this is equivalent to the -d recurse option.

"man grep" on a more recent ubuntu system:

       -r, --recursive
              Read all files under each directory, recursively, following symbolic links only if they are on the command line.  This
              is equivalent to the -d recurse option.

So we have an issue when the SDK installer (even with
buildtools-tarball) is used on old hosts since it may try and
dereference paths which it should not. This is caused by differences in
the behaviour of grep -r on older systems.

The fix is to wrap this in find so that only real files are found (as
elsewhere in the script.

[YOCTO #6577]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/populate_sdk_base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 893afbb..06112dc 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -285,7 +285,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 grep "^#!.*perl" -rl $native_sysroot); do
+for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep "^#!.*perl" -l '{}' \;); 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



More information about the Openembedded-commits mailing list