summaryrefslogtreecommitdiffstats
path: root/meta/classes/archiver.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-05-29 22:53:06 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 12:04:45 +0100
commite40995e569289598a1d9d71e19734402f2b54718 (patch)
tree108328e272a149da0e27dec0e0f0bebe602b80b8 /meta/classes/archiver.bbclass
parente4c35790d6dc23a0933f188f52fa4434784e1d98 (diff)
downloadpoky-e40995e569289598a1d9d71e19734402f2b54718.tar.gz
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] (From OE-Core rev: a07d03cc6f67c88feb9813ae7deb6e4a93552dfe) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r--meta/classes/archiver.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index ac8aa957e3..67eac84314 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -362,6 +362,7 @@ def dumpdata(d):
362def create_diff_gz(d): 362def create_diff_gz(d):
363 '''creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.g gz for mapping all content in 's' including patches to xxx.diff.gz''' 363 '''creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.g gz for mapping all content in 's' including patches to xxx.diff.gz'''
364 import shutil 364 import shutil
365 import subprocess
365 366
366 work_dir = d.getVar('WORKDIR', True) 367 work_dir = d.getVar('WORKDIR', True)
367 exclude_from = d.getVar('ARCHIVE_EXCLUDE_FROM', True).split() 368 exclude_from = d.getVar('ARCHIVE_EXCLUDE_FROM', True).split()
@@ -387,7 +388,7 @@ def create_diff_gz(d):
387 try: 388 try:
388 shutil.copy(i, dest) 389 shutil.copy(i, dest)
389 except IOError: 390 except IOError:
390 os.system('fakeroot cp -rf ' + i + " " + dest ) 391 subprocess.call('fakeroot cp -rf ' + i + " " + dest, shell=True)
391 392
392 bb.note("Creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.gz") 393 bb.note("Creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.gz")
393 cmd = "LC_ALL=C TZ=UTC0 diff --exclude-from=" + work_dir + "/temp/exclude-from-file -Naur " + s + '.org' + ' ' + s + " | gzip -c > " + diff_file 394 cmd = "LC_ALL=C TZ=UTC0 diff --exclude-from=" + work_dir + "/temp/exclude-from-file -Naur " + s + '.org' + ' ' + s + " | gzip -c > " + diff_file