1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

classes/oeqa: Replace subprocess.check_call() with check_output()

If you use subprocess.check_output() the traceback will contain the output
when the command fails which is very useful for debugging. There is no
good reason not to use this everywhere.

(From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2017-01-23 17:43:40 +00:00
parent 0a30ae5e18
commit 6ab4c5033a
7 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -573,14 +573,14 @@ python sstate_hardcode_path () {
sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, xargs_no_empty_run_cmd, sstate_sed_cmd)
bb.note("Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd))
subprocess.check_call(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
subprocess.check_output(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
# If the fixmefn is empty, remove it..
if os.stat(fixmefn).st_size == 0:
os.remove(fixmefn)
else:
bb.note("Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd))
subprocess.check_call(sstate_filelist_relative_cmd, shell=True)
subprocess.check_output(sstate_filelist_relative_cmd, shell=True)
}
def sstate_package(ss, d):
+3 -3
View File
@@ -290,7 +290,7 @@ def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d):
fixme_path = d.getVar(fixmevar)
cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
bb.note(cmd)
subprocess.check_call(cmd, shell=True)
subprocess.check_output(cmd, shell=True)
def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
@@ -333,7 +333,7 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
for p in postinsts:
subprocess.check_call(p, shell=True)
subprocess.check_output(p, shell=True)
#
# Manifests here are complicated. The main sysroot area has the unpacked sstate
@@ -561,7 +561,7 @@ python extend_recipe_sysroot() {
staging_processfixme(fixme[f], multilibs[f].getVar("RECIPE_SYSROOT"), recipesysroot, recipesysrootnative, d)
for p in postinsts:
subprocess.check_call(p, shell=True)
subprocess.check_output(p, shell=True)
for dep in configuredeps:
c = setscenedeps[dep][0]
+1 -1
View File
@@ -60,7 +60,7 @@ python uninative_event_fetchloader() {
os.symlink(localpath, tarballpath)
cmd = d.expand("mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; cd ${UNINATIVE_STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
subprocess.check_call(cmd, shell=True)
subprocess.check_output(cmd, shell=True)
with open(loaderchksum, "w") as f:
f.write(chksum)