The is_elf function is simply looking for the substring ELF in the output from file. But file, by default, prefixes the outut with the filename. If the filename containts the substring ELF anywhere, is_elf would identify it as a ELF.
The --brief (or -b) flag of GNU's file utility makes file not prepend filename to the output. Signed-off-by: Olof Johansson <[email protected]> --- meta/lib/oe/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index f1f9333e0f..eab94feb91 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -78,7 +78,7 @@ def is_elf(path, on_error=_is_elf_error): A return value of 0 means that the file is not an ELF file. """ ret, result = oe.utils.getstatusoutput( - "file \"%s\"" % path.replace("\"", "\\\"")) + "file -b \"%s\"" % path.replace("\"", "\\\"")) if ret: error_cb('"file %s" failed') -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
