From 06671f4b2167951c6b46401b0f5ac8af4d48d50a Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Fri, 16 Aug 2019 23:40:19 +0200 Subject: ui-snapshot: add support for lzip compression This patch adds support for lzip [1] compressed snapshots (*.tar.lz) [1] https://www.nongnu.org/lzip/ Signed-off-by: Hanspeter Portner Signed-off-by: Jason A. Donenfeld --- ui-snapshot.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ui-snapshot.c') diff --git a/ui-snapshot.c b/ui-snapshot.c index 9461d51..92cde42 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -79,6 +79,12 @@ static int write_tar_bzip2_archive(const char *hex, const char *prefix) return write_compressed_tar_archive(hex, prefix, argv); } +static int write_tar_lzip_archive(const char *hex, const char *prefix) +{ + char *argv[] = { "lzip", NULL }; + return write_compressed_tar_archive(hex, prefix, argv); +} + static int write_tar_xz_archive(const char *hex, const char *prefix) { char *argv[] = { "xz", NULL }; @@ -90,6 +96,7 @@ const struct cgit_snapshot_format cgit_snapshot_formats[] = { { ".tar", "application/x-tar", write_tar_archive }, { ".tar.gz", "application/x-gzip", write_tar_gzip_archive }, { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive }, + { ".tar.lz", "application/x-lzip", write_tar_lzip_archive }, { ".tar.xz", "application/x-xz", write_tar_xz_archive }, { ".zip", "application/x-zip", write_zip_archive }, { NULL } -- cgit v1.2.3