summaryrefslogtreecommitdiffstats
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:25 +0100
commit877b27b0cbf4f4544f75e0f0a78a82baeb46b159 (patch)
tree73ada982b7304870de1b258512a188bae354b4fc
parent24a4b34e25548d71bd430224adb58d87015674a7 (diff)
downloadopenembedded-core-contrib-877b27b0cbf4f4544f75e0f0a78a82baeb46b159.tar.gz
archiver: Configurable tarball compression
In order to be more efficient, we use xz as compression method to create GPL sources archives. 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>
-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"
ARCHIVER_MODE[dumpdata] ?= "0"
ARCHIVER_MODE[recipe] ?= "0"
ARCHIVER_MODE[mirror] ?= "split"
+ARCHIVER_MODE[compression] ?= "gz"
DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources"
ARCHIVER_TOPDIR ?= "${WORKDIR}/archiver-sources"
@@ -409,15 +410,16 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
# that we archive the actual directory and not just the link.
srcdir = os.path.realpath(srcdir)
+ compression_method = d.getVarFlag('ARCHIVER_MODE', 'compression')
bb.utils.mkdirhier(ar_outdir)
if suffix:
- filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix)
+ filename = '%s-%s.tar.%s' % (d.getVar('PF'), suffix, compression_method)
else:
- filename = '%s.tar.gz' % d.getVar('PF')
+ filename = '%s.tar.%s' % (d.getVar('PF'), compression_method)
tarname = os.path.join(ar_outdir, filename)
bb.note('Creating %s' % tarname)
- tar = tarfile.open(tarname, 'w:gz')
+ tar = tarfile.open(tarname, 'w:%s' % compression_method)
tar.add(srcdir, arcname=os.path.basename(srcdir), filter=exclude_useless_paths)
tar.close()