pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

documentation missing on how to compress zip archive #368

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The documentation on how to set compression on zip & configure it is missing.

Naiively I assume:
archive_write_set_format_zip
archive_write_set_options("compression-level=9")

would work but that returns ARCHIVE_WARN.  Same goes for any other setting of 
options (format, compressor).  Am I supposed to set the compressor as gzip to 
get entry-compression?

What is the expected output? What do you see instead?
The documentation is vague/missing on how to configure zip compression.

What version are you using?
2.8.3

On what operating system?
OSX

How did you build?  (cmake, configure, or pre-packaged binary)
Pre-packaged binary

Original issue reported on code.google.com by vlov...@gmail.com on 21 Jun 2014 at 12:59

GoogleCodeExporter commented 9 years ago
It looks like the zip options aren't in the archive_write_set_options manual 
page.
I've added them to the archive_write_set_options.3 manual page in git master.
Thank you for bringing it to my attention.

The test suite has many examples of using these options.  You can look through
libarchive/test/test_write_format_zip*.c for many examples of configuring
the zip writer.

To set compression for the following entries, you can use:

  archive_write_set_options(a, "zip:compression=store")
  archive_write_set_options(a, "zip:compression=deflate")

We do not currently support a compression-level option for
configuring the deflate compression level.

Note that the zip writer in libarchive 2.8.3 only supports the
compression option described here; the other documented
options I just added were all added later.

The Zip writer should use deflate compression by default unless
configured otherwise.  In particular, if the library is compiled without
Zlib support, then deflate compression will not be available.  If you are
seeing otherwise, please let us know.

Original comment by kientzle@gmail.com on 21 Jun 2014 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by kientzle@gmail.com on 21 Jun 2014 at 6:36

GoogleCodeExporter commented 9 years ago
Does the wiki need an update too, or is that just auto-generated from the man 
pages?

Thanks for letting me know.  I kind of just assumed that I could configure the 
compression level.

Original comment by vlov...@gmail.com on 21 Jun 2014 at 6:51

GoogleCodeExporter commented 9 years ago
I've regenerated all of the "ManPageXyz" wiki pages from the mdoc sources.  
They should be up-to-date with git master now.

Adding an option to set the compression level would be pretty straightforward:  
Send me a pull request.  ;-)

Original comment by kientzle@gmail.com on 21 Jun 2014 at 9:17