2

I know that a typical .deb file contains three files:

debian-binary
control.tar.gz
data.tar.gz

and that some are xz compressed instead of gzip (control.tar.xz, data.tar.xz).

What are other compression supported for debian files? And how does debian installer knows which decompression to use?

If I want to add support for another compression (for example, zopfli - https://github.com/google/zopfli). Is there source code for debian installer available which I could modify to make this addition possible?

2

From this blog post, it seems dpkg-deb handles compression. And from man dpkg-deb for 14.04:

-Zcompress-type
      Specify  which  compression type to use when building a package.
      Allowed values are gzip, xz, bzip2, lzma, and none  (default  is
      xz).

In 15.10:

-Zcompress-type
      Specify which compression type to use when building  a  package.
      Allowed   values   are  gzip,  xz  (since  dpkg  1.15.6),  bzip2
      (deprecated), lzma (since dpkg  1.14.0;  deprecated),  and  none
      (default is xz).

The source code for dpkg can be browsed at Debian Alioth. From what I can tell, it also uses tar in places, and if tar doesn't support zopfli, get ready to add support for zopfli to GNU tar as well.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.