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 <benjamin.drung@cloud.ionos.com>
pull/1/head
Benjamin Drung 5 years ago committed by Johannes 'josch' Schauer
parent bc423e6ab6
commit 4b82a664da
Signed by: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -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);

Loading…
Cancel
Save