Bug 447421 - Add support for lzip compression
Summary: Add support for lzip compression
Status: RESOLVED FIXED
Alias: None
Product: frameworks-karchive
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.89.0
Platform: Slackware Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-23 12:19 UTC by Heinz Wiesinger
Modified: 2025-05-13 22:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinz Wiesinger 2021-12-23 12:19:17 UTC
SUMMARY

It would be nice if karchive had support for lzip compression. An example where this is more and more used is source file distributions in the form of "tar.lz" archives.

A library that can be used for this is lzlib: http://www.nongnu.org/lzip/lzlib.html
Comment 1 Albert Astals Cid 2025-05-13 22:13:43 UTC
Git commit 78cddbf15c39cd81dab8eceadbd5619e37ff016d by Albert Astals Cid, on behalf of Azhar Momin.
Committed on 13/05/2025 at 22:13.
Pushed by aacid into branch 'master'.

Add LZIP compression support to KArchive

- Implement KLzFilter for LZIP compression and decompression.
- Update KCompressionDevice to recognize lz files.
- Modify KTar to handle LZIP compressed tar files.
- Update autotests to include LZIP support.

LZIP uses a simple format consisting of a header, an LZMA stream, and a trailer for each member:

```
  +--+--+--+--+----+----+=============+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | ID string | VN | DS | LZMA stream | CRC32 |   Data size   |  Member size  |
  +--+--+--+--+----+----+=============+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
```

This implementation parses and writes single-member archives. It can also handle multi-member archives when built with liblzma ≥ 5.4.0.

Reference: https://www.nongnu.org/lzip/manual/lzip_manual.html

M  +24   -17   autotests/CMakeLists.txt
M  +2    -0    autotests/karchivetest.cpp
M  +11   -0    autotests/kcompressiondevicetest.cpp
M  +1    -0    autotests/kcompressiondevicetest.h
M  +17   -0    autotests/kfiltertest.cpp
M  +1    -0    autotests/kfiltertest.h
M  +1    -1    src/CMakeLists.txt
M  +17   -0    src/kcompressiondevice.cpp
M  +2    -0    src/kcompressiondevice.h
A  +392  -0    src/klzfilter.cpp     [License: LGPL(v2.0+)]
A  +48   -0    src/klzfilter.h     [License: LGPL(v2.0+)]
M  +5    -0    src/ktar.cpp
M  +2    -1    src/ktar.h

https://invent.kde.org/frameworks/karchive/-/commit/78cddbf15c39cd81dab8eceadbd5619e37ff016d