[oe-commits] [openembedded-core] 13/18: archiver: Drop unwanted directories

git at git.openembedded.org git at git.openembedded.org
Sat Nov 24 21:48:03 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch sumo
in repository openembedded-core.

commit f0eebea19ff8d9dfd89d104be04ca3510a546424
Author: Fabien Lahoudere <fabien.lahoudere at collabora.com>
AuthorDate: Mon Oct 29 12:02:29 2018 +0100

    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 at collabora.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/classes/archiver.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 31c9b7e..d68add9 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -267,6 +267,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
@@ -291,7 +299,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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list