Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
lib-compression: Remove xz/lzma write support
For now, we keep the read support to allow for a more gradual migration from
lzma/xz.

The code has bugs.  Additionally, there is no benefit in keeping it around.
bzip2 or zstd (at maximum compression level) are likely better choices for
archival.  For non-archival usecases, a light compression algorithm like
zstd (at low to medium compression level) or lz4 are better choices.
  • Loading branch information
Josef 'Jeff' Sipek committed Feb 4, 2021
1 parent 4b1c694 commit 6e5ae5e
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 279 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -172,7 +172,7 @@ AS_HELP_STRING([--with-bzlib], [Build with bzlib compression support (auto)]),
want_bzlib=auto)

AC_ARG_WITH(lzma,
AS_HELP_STRING([--with-lzma], [Build with LZMA compression support (auto)]),
AS_HELP_STRING([--with-lzma], [Build with LZMA decompression support (auto)]),
TEST_WITH(lzma, $withval),
want_lzma=auto)

Expand Down
11 changes: 0 additions & 11 deletions run-test-valgrind.supp
Expand Up @@ -4,17 +4,6 @@
fun:malloc
obj:*/bash
}
{
<liblzma>
Memcheck:Cond
obj:/lib/x86_64-linux-gnu/liblzma.so.5.*
obj:/lib/x86_64-linux-gnu/liblzma.so.5.*
obj:/lib/x86_64-linux-gnu/liblzma.so.5.*
obj:/lib/x86_64-linux-gnu/liblzma.so.5.*
obj:/lib/x86_64-linux-gnu/liblzma.so.5.*
fun:lzma_stream_encoder
fun:lzma_easy_encoder
}
{
<openssl_centos6_i386_v1_0_1_compression_methods>
Memcheck:Leak
Expand Down
1 change: 0 additions & 1 deletion src/lib-compression/Makefile.am
Expand Up @@ -13,7 +13,6 @@ libcompression_la_SOURCES = \
istream-zlib.c \
istream-bzlib.c \
istream-zstd.c \
ostream-lzma.c \
ostream-lz4.c \
ostream-zlib.c \
ostream-bzlib.c \
Expand Down
3 changes: 1 addition & 2 deletions src/lib-compression/compression.c
Expand Up @@ -19,7 +19,6 @@
#endif
#ifndef HAVE_LZMA
# define i_stream_create_lzma NULL
# define o_stream_create_lzma NULL
#endif
#ifndef HAVE_LZ4
# define i_stream_create_lz4 NULL
Expand Down Expand Up @@ -162,7 +161,7 @@ const struct compression_handler compression_handlers[] = {
{ "deflate", NULL, NULL,
i_stream_create_deflate, o_stream_create_deflate },
{ "xz", ".xz", is_compressed_xz,
i_stream_create_lzma, o_stream_create_lzma },
i_stream_create_lzma, NULL },
{ "lz4", ".lz4", is_compressed_lz4,
i_stream_create_lz4, o_stream_create_lz4 },
{ "zstd", ".zstd", is_compressed_zstd,
Expand Down
263 changes: 0 additions & 263 deletions src/lib-compression/ostream-lzma.c

This file was deleted.

1 change: 0 additions & 1 deletion src/lib-compression/ostream-zlib.h
Expand Up @@ -4,7 +4,6 @@
struct ostream *o_stream_create_gz(struct ostream *output, int level);
struct ostream *o_stream_create_deflate(struct ostream *output, int level);
struct ostream *o_stream_create_bz2(struct ostream *output, int level);
struct ostream *o_stream_create_lzma(struct ostream *output, int level);
struct ostream *o_stream_create_lz4(struct ostream *output, int level);
struct ostream *o_stream_create_zstd(struct ostream *output, int level);

Expand Down
1 change: 1 addition & 0 deletions src/lib-compression/test-compression.c
Expand Up @@ -730,6 +730,7 @@ static void test_compression_int(bool autodetect)

for (i = 0; compression_handlers[i].name != NULL; i++) {
if (compression_handlers[i].create_istream != NULL &&
compression_handlers[i].create_ostream != NULL &&
(!autodetect ||
compression_handlers[i].is_compressed != NULL)) T_BEGIN {
if (compression_handlers[i].is_compressed != NULL &&
Expand Down

0 comments on commit 6e5ae5e

Please sign in to comment.