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>
This commit is contained in:
Benjamin Drung 2019-11-12 19:17:30 +01:00 committed by Johannes 'josch' Schauer
parent bc423e6ab6
commit 4b82a664da
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -2403,6 +2403,11 @@ sub main() {
my $exitstatus = 0; my $exitstatus = 0;
my @taropts = ('--sort=name', "--mtime=\@$mtime", '--clamp-mtime', '--numeric-owner', '--one-file-system', '-c', '--exclude=./dev'); 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 # disable signals so that we can fork and change behaviour of the signal
# handler in the parent and child without getting interrupted # handler in the parent and child without getting interrupted
my $sigset = POSIX::SigSet->new(SIGINT, SIGHUP, SIGPIPE, SIGTERM); my $sigset = POSIX::SigSet->new(SIGINT, SIGHUP, SIGPIPE, SIGTERM);