]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/package_tar: fix conflicts with package_deb / package_ipk
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 24 Feb 2014 16:05:45 +0000 (16:05 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 24 Feb 2014 16:18:57 +0000 (16:18 +0000)
Avoid tar noticing that the directory is changing when
do_package_write_deb or do_package_write_ipk are running at the same
time as do_package_write_tar (because DEBIAN and CONTROL are being added
and removed while tar is running so the directory changes).

Fixes [YOCTO #5652]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package_tar.bbclass

index 2d6fc8fe215fcc3b6e59723a5453aa0ed5a77510..fed2c28b690f8c5fc23940275f8b76c2c90c1e75 100644 (file)
@@ -41,11 +41,12 @@ python do_package_tar () {
         basedir = os.path.dirname(root)
         tarfn = localdata.expand("${DEPLOY_DIR_TAR}/${PKG}-${PKGV}-${PKGR}.tar.gz")
         os.chdir(root)
-        from glob import glob
-        if not glob('*'):
+        dlist = os.listdir(root)
+        if not dlist:
             bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
             continue
-        ret = subprocess.call("tar -czf %s %s" % (tarfn, '.'), shell=True)
+        args = "tar -cz --exclude=CONTROL --exclude=DEBIAN -f".split()
+        ret = subprocess.call(args + [tarfn] + dlist)
         if ret != 0:
             bb.error("Creation of tar %s failed." % tarfn)
 }