From 4b82a664daa5b2430a00b737706ee77c75288158 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Tue, 12 Nov 2019 19:17:30 +0100 Subject: [PATCH] Use parallel xz compression One of mmdebstrap benefits over deboostrap is that it is faster. Creating a xz tarball as output will take a lot of time, since xz consumes a lot of compute power and tar uses only one core. Therefore use parallel xz compression since xz supports it using the -T parameter. Closes: #943327 Signed-off-by: Benjamin Drung --- mmdebstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index b21d956..06be8e3 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -2403,6 +2403,11 @@ sub main() { my $exitstatus = 0; my @taropts = ('--sort=name', "--mtime=\@$mtime", '--clamp-mtime', '--numeric-owner', '--one-file-system', '-c', '--exclude=./dev'); + # Use parallel xz compression + if (defined $tar_compressor and $tar_compressor eq 'xz') { + push @taropts, '-Ixz --threads=0' + } + # disable signals so that we can fork and change behaviour of the signal # handler in the parent and child without getting interrupted my $sigset = POSIX::SigSet->new(SIGINT, SIGHUP, SIGPIPE, SIGTERM);