1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-16 15:57:04 +00:00

classes/lib: Fix getcmdstatus breakage

I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets
add a wrapper and have this work in both worlds.

(From OE-Core rev: 2253e9f12734c6e6aa489942b5e4628eca1fa29d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-05-09 14:55:04 +00:00
parent d529c11fa5
commit b54339d633
6 changed files with 20 additions and 11 deletions
+2 -2
View File
@@ -254,7 +254,7 @@ do_kernel_configme() {
}
python do_kernel_configcheck() {
import re, string, sys, subprocess
import re, string, sys
bb.plain("NOTE: validating kernel config, see log.do_kernel_configcheck for details")
@@ -265,7 +265,7 @@ python do_kernel_configcheck() {
pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/")
cmd = d.expand("cd ${S}; kconf_check -config- %s/meta-series ${S} ${B}" % kmeta)
ret, result = subprocess.getstatusoutput("%s%s" % (pathprefix, cmd))
ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
config_check_visibility = d.getVar( "KCONF_AUDIT_LEVEL", True ) or 1
if config_check_visibility == 1:
+2 -2
View File
@@ -696,7 +696,7 @@ python fixup_perms () {
}
python split_and_strip_files () {
import stat, errno, subprocess
import stat, errno
dvar = d.getVar('PKGD', True)
pn = d.getVar('PN', True)
@@ -732,7 +732,7 @@ python split_and_strip_files () {
# 16 - kernel module
def isELF(path):
type = 0
ret, result = subprocess.getstatusoutput("file '%s'" % path)
ret, result = oe.utils.getstatusoutput("file '%s'" % path)
if ret:
bb.error("split_and_strip_files: 'file %s' failed" % path)
+2 -3
View File
@@ -342,13 +342,12 @@ def check_gcc_march(sanity_data):
f = open("gcc_test.c", "w")
f.write("int main (){ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4; return 0;}\n")
f.close()
import subprocess
# Check if GCC could work without march
status,result = subprocess.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
status,result = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
if status != 0:
# Check if GCC could work with march
status,result = subprocess.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
status,result = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
if status == 0:
result = True
else: