diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-05-29 22:53:06 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 10:56:15 +0100 |
commit | a07d03cc6f67c88feb9813ae7deb6e4a93552dfe (patch) | |
tree | d95be4dce79dfdce785d92b18f82dfa656a529f4 /meta/classes/sstate.bbclass | |
parent | b1ea93143a473f006b31ab22f88baf41661971a7 (diff) | |
download | openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.gz openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.bz2 openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.zip |
meta: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found
More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements
[YOCTO #2454]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r-- | meta/classes/sstate.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ae019379bd..4242f88544 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -145,6 +145,7 @@ def sstate_install(ss, d): def sstate_installpkg(ss, d): import oe.path + import subprocess def prepdir(dir): # remove dir if it exists, ensure any parent directories do exist @@ -195,7 +196,7 @@ def sstate_installpkg(ss, d): sstate_hardcode_cmd = "sed -e 's:^:%s:g' %s | xargs %s" % (sstateinst, fixmefn, sstate_sed_cmd) print "Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd) - os.system(sstate_hardcode_cmd) + subprocess.call(sstate_hardcode_cmd, shell=True) # Need to remove this or we'd copy it into the target directory and may # conflict with another writer @@ -309,6 +310,8 @@ python sstate_cleanall() { } def sstate_hardcode_path(d): + import subprocess + # Need to remove hardcoded paths and fix these when we install the # staging packages. # @@ -343,14 +346,14 @@ def sstate_hardcode_path(d): sstate_hardcode_cmd = "%s | xargs %s | %s | xargs --no-run-if-empty %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, sstate_sed_cmd) print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd) - os.system(sstate_hardcode_cmd) + subprocess.call(sstate_hardcode_cmd, shell=True) # If the fixmefn is empty, remove it.. if os.stat(fixmefn).st_size == 0: os.remove(fixmefn) else: print "Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd) - os.system(sstate_filelist_relative_cmd) + subprocess.call(sstate_filelist_relative_cmd, shell=True) def sstate_package(ss, d): import oe.path |