]> code.ossystems Code Review - openembedded-core.git/commit
package.bbclass: Add '-b' option to file call in isELF
authorMark Hatle <mark.hatle@windriver.com>
Fri, 4 May 2018 19:31:32 +0000 (12:31 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 May 2018 14:37:10 +0000 (15:37 +0100)
commitb6d5729a0f0e6f2c8b36d425a18e9e2ed26f5de0
tree0b9cc8092f89bf1cbbf0a970918c1fe298fa164b
parent080f0ee910684beb8bc263d5a45d3aa39b6ee647
package.bbclass: Add '-b' option to file call in isELF

The isELF function works by running:

   result = file <pathname>
   if 'ELF' in result

By default 'file' will prepend the result with the path name of the file
that is being checked.  This usually works fine, such as:

$ file /home/foo/openembedded-core/meta/classes/package.bbclass
/home/foo/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines

However, if the path includes 'ELF', ELF will end up in the result, and then
the check will return positive.

$ file /home/ELF/openembedded-core/meta/classes/package.bbclass
/home/ELF/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines

This will then result in the isELF coming back true, and possibly causing the
checks that use isELF, such as the 'is it already stripped' check, to do the
incorrect thing.

Adding the '-b' option to file will result in the path being omitted in the
result:

$ file /home/ELF/openembedded-core/meta/classes/package.bbclass
Python script, ASCII text executable, with very long lines

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 5a324e9b2cf6378f8eaa4e394f9cb36d4e2680ac)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass
meta/lib/oe/package.py