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-07 23:08:55 +0000 |
commit | 82da3463c8cffb679cdaa30de5c5bc0dbeb49c1a (patch) | |
tree | 67fb68af27c243cb9d8d54f57ca3db82238e542c /meta/classes/archiver.bbclass | |
parent | a73ea9411351e21e005d5fb33491e35618f6e105 (diff) | |
download | poky-82da3463c8cffb679cdaa30de5c5bc0dbeb49c1a.tar.gz |
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}"'
(From OE-Core rev: 3904f98851c6a63dd9377e38f1432be6b1c0a94d)
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-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() { | |||
275 | create_tarball(d, srcdir, 'configured', ar_outdir) | 275 | create_tarball(d, srcdir, 'configured', ar_outdir) |
276 | } | 276 | } |
277 | 277 | ||
278 | def exclude_useless_paths(tarinfo): | ||
279 | if tarinfo.isdir(): | ||
280 | if tarinfo.name.endswith('/temp') or tarinfo.name.endswith('/patches') or tarinfo.name.endswith('/.pc'): | ||
281 | return None | ||
282 | elif tarinfo.name == 'temp' or tarinfo.name == 'patches' or tarinfo.name == '.pc': | ||
283 | return None | ||
284 | return tarinfo | ||
285 | |||
278 | def create_tarball(d, srcdir, suffix, ar_outdir): | 286 | def create_tarball(d, srcdir, suffix, ar_outdir): |
279 | """ | 287 | """ |
280 | create the tarball from srcdir | 288 | create the tarball from srcdir |
@@ -299,7 +307,7 @@ def create_tarball(d, srcdir, suffix, ar_outdir): | |||
299 | 307 | ||
300 | bb.note('Creating %s' % tarname) | 308 | bb.note('Creating %s' % tarname) |
301 | tar = tarfile.open(tarname, 'w:gz') | 309 | tar = tarfile.open(tarname, 'w:gz') |
302 | tar.add(srcdir, arcname=os.path.basename(srcdir)) | 310 | tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths) |
303 | tar.close() | 311 | tar.close() |
304 | 312 | ||
305 | # creating .diff.gz between source.orig and source | 313 | # creating .diff.gz between source.orig and source |