Am Mittwoch, den 13.11.2019, 17:54 +0100 schrieb Johannes Schauer:
> Quoting Benjamin Drung (2019-11-13 17:08:46)
> > > with some minor changes committed here:
> > > 
> > > https://gitlab.mister-muffin.de/josch/mmdebstrap/commit/4b82a664daa5b2430a00b737706ee77c75288158
> > 
> > Sadly, this change breaks mmdebstrap:
> > 
> > $ LANG=C tar -tf root.tar.xz 
> > ./dev/
> > ./dev/console
> > ./dev/fd
> > ./dev/full
> > ./dev/null
> > ./dev/ptmx
> > ./dev/pts/
> > ./dev/random
> > ./dev/shm/
> > ./dev/stderr
> > ./dev/stdin
> > ./dev/stdout
> > ./dev/tty
> > ./dev/urandom
> > ./dev/zero
> > tar: Skipping to next header
> > tar: Exiting with failure status due to previous errors
> > 
> > When I developed the patch, I just checked that the tarball was
> > created and
> > the file size matches, but I didn't check the content.
> 
> ah indeed. This is of course because mmdebstrap assembles the tarball
> from two
> parts and then runs the compressor outside of tar. A correct patch
> probably
> look more like this:
> 
> @@ -161,7 +161,7 @@ sub get_tar_compressor($) {
>      } elsif ($filename =~ /\.lz4$/) {
>         return 'lz4';
>      } elsif ($filename =~ /\.(xz|txz)$/) {
> -       return 'xz';
> +       return ('xz', '--threads=0');
>      } elsif ($filename =~ /\.zst$/) {
>         return 'zstd';
>      }

I have tested this proposed change by dirty patching the two exec
lines:

    exec ($tar_compressor, '--threads=0') or error "[...]";

It works and creates a tarball. The generated tarball is actually
working (verified by using it).

-- 
Benjamin Drung

Debian & Ubuntu Developer
Platform Engineering Compute (Enterprise Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.dr...@cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498
Vorstand: Dr. Christian Böing, Hüseyin Dogan, Hans-Henning Kettler,
Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke
Member of United Internet

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to