diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 14:20:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 14:20:04 +0100 |
commit | f5356062443320c29a19cfd7113128caa185b221 (patch) | |
tree | e1458660ec06896311c93ac6f17b1b4c5afc24c5 /meta/classes/insane.bbclass | |
parent | 004ba67298e3e6e618df29597e9166c971a1941c (diff) | |
download | openembedded-core-f5356062443320c29a19cfd7113128caa185b221.tar.gz openembedded-core-f5356062443320c29a19cfd7113128caa185b221.tar.bz2 openembedded-core-f5356062443320c29a19cfd7113128caa185b221.zip |
Revert "meta: replace os.popen with subprocess.Popen"
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion
is not correct. Its replacing readlines() calls which generate an array with
what are effectively strings. There are split("\n") calls missing in many
cases so this needs to be reverted until it gets fixed.
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index fa7b5f0bc2..4d139e813f 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -154,29 +154,14 @@ def package_qa_check_rpath(file,name, d, elf, messages): if not bad_dirs[0] in d.getVar('WORKDIR', True): bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check") - output, errors = bb.process.run("%s -B -F%%r#F '%s'" % (scanelf,file)) - txt = output.split() + output = os.popen("%s -B -F%%r#F '%s'" % (scanelf,file)) + txt = output.readline().split() for line in txt: for dir in bad_dirs: if dir in line: messages.append("package %s contains bad RPATH %s in file %s" % (name, line, file)) QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths" - -def package_qa_get_objdump(d, path): - """ - Get the result of objdump, ignore the errors since not all files can be objdumped - """ - env_path = d.getVar('PATH', True) - objdump = d.getVar('OBJDUMP', True) - - try: - lines = "" - lines = bb.process.run("LC_ALL=C PATH=%s %s -p '%s'" % (env_path, objdump, path))[0] - except Exception: - sys.exc_clear() - return lines - def package_qa_check_useless_rpaths(file, name, d, elf, messages): """ Check for RPATHs that are useless but not dangerous @@ -184,12 +169,15 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages): if not elf: return + objdump = d.getVar('OBJDUMP', True) + env_path = d.getVar('PATH', True) + libdir = d.getVar("libdir", True) base_libdir = d.getVar("base_libdir", True) import re rpath_re = re.compile("\s+RPATH\s+(.*)") - for line in package_qa_get_objdump(d, file): + for line in os.popen("LC_ALL=C PATH=%s %s -p '%s' 2> /dev/null" % (env_path, objdump, file), "r"): m = rpath_re.match(line) if m: rpath = m.group(1) @@ -381,7 +369,7 @@ def package_qa_check_desktop(path, name, d, elf, messages): """ if path.endswith(".desktop"): desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE',True),'desktop-file-validate') - output, errors = bb.process.run("%s %s" % (desktop_file_validate, path)) + output = os.popen("%s %s" % (desktop_file_validate, path)) # This only produces output on errors for l in output: messages.append("Desktop file issue: " + l.strip()) @@ -404,11 +392,14 @@ def package_qa_hash_style(path, name, d, elf, messages): if not gnu_hash: return + objdump = d.getVar('OBJDUMP', True) + env_path = d.getVar('PATH', True) + sane = False has_syms = False # If this binary has symbols, we expect it to have GNU_HASH too. - for line in package_qa_get_objdump(d, path): + for line in os.popen("LC_ALL=C PATH=%s %s -p '%s' 2> /dev/null" % (env_path, objdump, path), "r"): if "SYMTAB" in line: has_syms = True if "GNU_HASH" in line: |