On 9/20/21 3:25 AM, Ian Ray wrote:
In order to be more efficient, we use xz as compression method
to create GPL sources archives.

Signed-off-by: Fabien Lahoudere <fabien.lahoud...@collabora.com>
[V1 was https://patchwork.openembedded.org/patch/155985/]
[Rebased]

xz has its own mind when it comes to parallel threads, how do we control that here? Does it use the global setting to control the number of xz threads ?

Signed-off-by: Ian Ray <ian....@ge.com>
---
  meta/classes/archiver.bbclass | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index dd31dc0..411d459 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()




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156331): 
https://lists.openembedded.org/g/openembedded-core/message/156331
Mute This Topic: https://lists.openembedded.org/mt/85841980/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to