summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorFabien Lahoudere <fabien.lahoudere@collabora.com>2018-10-29 12:02:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-24 21:45:58 +0000
commita2eb50176b800c49c3899fa2f87585a869690bfa (patch)
tree989d38e33c7742e11a5dde6754779f12a8ee5554 /meta
parent52db6681b25342ba3ee336a777594e0a59a84d78 (diff)
downloadpoky-a2eb50176b800c49c3899fa2f87585a869690bfa.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) (From OE-Core rev: f0eebea19ff8d9dfd89d104be04ca3510a546424) Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/archiver.bbclass10
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 31c9b7eb4b..d68add9e5d 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -267,6 +267,14 @@ python do_ar_configured() {
267 create_tarball(d, srcdir, 'configured', ar_outdir) 267 create_tarball(d, srcdir, 'configured', ar_outdir)
268} 268}
269 269
270def exclude_useless_paths(tarinfo):
271 if tarinfo.isdir():
272 if tarinfo.name.endswith('/temp') or tarinfo.name.endswith('/patches') or tarinfo.name.endswith('/.pc'):
273 return None
274 elif tarinfo.name == 'temp' or tarinfo.name == 'patches' or tarinfo.name == '.pc':
275 return None
276 return tarinfo
277
270def create_tarball(d, srcdir, suffix, ar_outdir): 278def create_tarball(d, srcdir, suffix, ar_outdir):
271 """ 279 """
272 create the tarball from srcdir 280 create the tarball from srcdir
@@ -291,7 +299,7 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
291 299
292 bb.note('Creating %s' % tarname) 300 bb.note('Creating %s' % tarname)
293 tar = tarfile.open(tarname, 'w:gz') 301 tar = tarfile.open(tarname, 'w:gz')
294 tar.add(srcdir, arcname=os.path.basename(srcdir)) 302 tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths)
295 tar.close() 303 tar.close()
296 304
297# creating .diff.gz between source.orig and source 305# creating .diff.gz between source.orig and source