summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorIan Ray <ian.ray@ge.com>2021-09-20 13:25:12 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-28 14:16:30 +0100
commit52e97dc769858ce2d2e735a832f67972927dba8c (patch)
tree38effba3fac190475aa90c70804f6273baf8cfe0 /meta/classes
parent5933782d2b82cd455e68359a0939a8b83bd566d6 (diff)
downloadpoky-52e97dc769858ce2d2e735a832f67972927dba8c.tar.gz
archiver: Configurable tarball compression
In order to be more efficient, we use xz as compression method to create GPL sources archives. (From OE-Core rev: 877b27b0cbf4f4544f75e0f0a78a82baeb46b159) Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> [V1 was https://patchwork.openembedded.org/patch/155985/] [Rebased] Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/archiver.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index dd31dc0cd8..411d459ed0 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -51,6 +51,7 @@ ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
51ARCHIVER_MODE[dumpdata] ?= "0" 51ARCHIVER_MODE[dumpdata] ?= "0"
52ARCHIVER_MODE[recipe] ?= "0" 52ARCHIVER_MODE[recipe] ?= "0"
53ARCHIVER_MODE[mirror] ?= "split" 53ARCHIVER_MODE[mirror] ?= "split"
54ARCHIVER_MODE[compression] ?= "gz"
54 55
55DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources" 56DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources"
56ARCHIVER_TOPDIR ?= "${WORKDIR}/archiver-sources" 57ARCHIVER_TOPDIR ?= "${WORKDIR}/archiver-sources"
@@ -409,15 +410,16 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
409 # that we archive the actual directory and not just the link. 410 # that we archive the actual directory and not just the link.
410 srcdir = os.path.realpath(srcdir) 411 srcdir = os.path.realpath(srcdir)
411 412
413 compression_method = d.getVarFlag('ARCHIVER_MODE', 'compression')
412 bb.utils.mkdirhier(ar_outdir) 414 bb.utils.mkdirhier(ar_outdir)
413 if suffix: 415 if suffix:
414 filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix) 416 filename = '%s-%s.tar.%s' % (d.getVar('PF'), suffix, compression_method)
415 else: 417 else:
416 filename = '%s.tar.gz' % d.getVar('PF') 418 filename = '%s.tar.%s' % (d.getVar('PF'), compression_method)
417 tarname = os.path.join(ar_outdir, filename) 419 tarname = os.path.join(ar_outdir, filename)
418 420
419 bb.note('Creating %s' % tarname) 421 bb.note('Creating %s' % tarname)
420 tar = tarfile.open(tarname, 'w:gz') 422 tar = tarfile.open(tarname, 'w:%s' % compression_method)
421 tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths) 423 tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths)
422 tar.close() 424 tar.close()
423 425