diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2018-04-16 11:34:18 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-04-18 18:57:06 +0100 |
commit | 49bfeb0a9c5aaa7226d6fba4f111bf77d23c771c (patch) | |
tree | 8cb791804c57ed940d8e71cb48cf10ba66c1584e /meta/lib | |
parent | 5514c292ea036e75f5cd8ffd409eba4709f19be6 (diff) | |
download | poky-49bfeb0a9c5aaa7226d6fba4f111bf77d23c771c.tar.gz |
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
(From OE-Core rev: 5a324e9b2cf6378f8eaa4e394f9cb36d4e2680ac)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 1e5c3aa8e1..599fca60f8 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py | |||
@@ -73,7 +73,7 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, qa_already_stripped= | |||
73 | def is_elf(path): | 73 | def is_elf(path): |
74 | exec_type = 0 | 74 | exec_type = 0 |
75 | ret, result = oe.utils.getstatusoutput( | 75 | ret, result = oe.utils.getstatusoutput( |
76 | "file \"%s\"" % path.replace("\"", "\\\"")) | 76 | "file -b \"%s\"" % path.replace("\"", "\\\"")) |
77 | 77 | ||
78 | if ret: | 78 | if ret: |
79 | bb.error("split_and_strip_files: 'file %s' failed" % path) | 79 | bb.error("split_and_strip_files: 'file %s' failed" % path) |