diff options
author | Fabien Lahoudere <fabien.lahoudere@collabora.com> | 2018-10-29 12:02:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-06 12:14:05 +0000 |
commit | 3904f98851c6a63dd9377e38f1432be6b1c0a94d (patch) | |
tree | ed3745e40148708d5ba6f54421c1e3c4317ba17c | |
parent | 2f86c3f1180ba8bf77301a0bc29c3b290bc28d91 (diff) | |
download | openembedded-core-3904f98851c6a63dd9377e38f1432be6b1c0a94d.tar.gz openembedded-core-3904f98851c6a63dd9377e38f1432be6b1c0a94d.tar.bz2 openembedded-core-3904f98851c6a63dd9377e38f1432be6b1c0a94d.zip |
archiver: Drop unwanted directories
In sources directory we can find patches/ and temp/.
The first one is filled with symbolic link unusable on another
machines.
The second contains yocto logs to create this archives and are
typically copied when 'S = "${WORKDIR}"'
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/archiver.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index abaef87fc0..0a9fe4fd1d 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass @@ -275,6 +275,14 @@ python do_ar_configured() { create_tarball(d, srcdir, 'configured', ar_outdir) } +def exclude_useless_paths(tarinfo): + if tarinfo.isdir(): + if tarinfo.name.endswith('/temp') or tarinfo.name.endswith('/patches') or tarinfo.name.endswith('/.pc'): + return None + elif tarinfo.name == 'temp' or tarinfo.name == 'patches' or tarinfo.name == '.pc': + return None + return tarinfo + def create_tarball(d, srcdir, suffix, ar_outdir): """ create the tarball from srcdir @@ -299,7 +307,7 @@ def create_tarball(d, srcdir, suffix, ar_outdir): bb.note('Creating %s' % tarname) tar = tarfile.open(tarname, 'w:gz') - tar.add(srcdir, arcname=os.path.basename(srcdir)) + tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths) tar.close() # creating .diff.gz between source.orig and source |