diff options
Diffstat (limited to 'meta/classes/package_tar.bbclass')
-rw-r--r-- | meta/classes/package_tar.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass index 68b1bf0fed..332fa3f230 100644 --- a/meta/classes/package_tar.bbclass +++ b/meta/classes/package_tar.bbclass | |||
@@ -9,6 +9,7 @@ python package_tar_fn () { | |||
9 | } | 9 | } |
10 | 10 | ||
11 | python package_tar_install () { | 11 | python package_tar_install () { |
12 | import subprocess | ||
12 | pkg = d.getVar('PKG', True) | 13 | pkg = d.getVar('PKG', True) |
13 | pkgfn = d.getVar('PKGFN', True) | 14 | pkgfn = d.getVar('PKGFN', True) |
14 | rootfs = d.getVar('IMAGE_ROOTFS', True) | 15 | rootfs = d.getVar('IMAGE_ROOTFS', True) |
@@ -29,12 +30,13 @@ python package_tar_install () { | |||
29 | bb.debug(1, "%s does not exist, skipping" % pkgfn) | 30 | bb.debug(1, "%s does not exist, skipping" % pkgfn) |
30 | raise bb.build.FuncFailed | 31 | raise bb.build.FuncFailed |
31 | 32 | ||
32 | ret = os.system('zcat %s | tar -xf -' % pkgfn) | 33 | ret = subprocess.call('zcat %s | tar -xf -' % pkgfn, shell=True) |
33 | if ret != 0: | 34 | if ret != 0: |
34 | raise bb.build.FuncFailed | 35 | raise bb.build.FuncFailed |
35 | } | 36 | } |
36 | 37 | ||
37 | python do_package_tar () { | 38 | python do_package_tar () { |
39 | import subprocess | ||
38 | workdir = d.getVar('WORKDIR', True) | 40 | workdir = d.getVar('WORKDIR', True) |
39 | if not workdir: | 41 | if not workdir: |
40 | bb.error("WORKDIR not defined, unable to package") | 42 | bb.error("WORKDIR not defined, unable to package") |
@@ -85,7 +87,7 @@ python do_package_tar () { | |||
85 | if not glob('*'): | 87 | if not glob('*'): |
86 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True))) | 88 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True))) |
87 | continue | 89 | continue |
88 | ret = os.system("tar -czf %s %s" % (tarfn, '.')) | 90 | ret = subprocess.call("tar -czf %s %s" % (tarfn, '.'), shell=True) |
89 | if ret != 0: | 91 | if ret != 0: |
90 | bb.error("Creation of tar %s failed." % tarfn) | 92 | bb.error("Creation of tar %s failed." % tarfn) |
91 | } | 93 | } |