Add support for LZ4-compressed tar archives
ClosedPublic

Authored by rthomsen on Jun 10 2016, 4:08 PM.

Details

Summary

Recently-released libarchive 3.2.0 adds support for LZ4-compression. We utilize this to enable support for LZ4-compressed tarballs in libarchiveplugin.

Libarchive requires the lz4 executable to be found in path.

Test archive:

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen updated this revision to Diff 4334.Jun 10 2016, 4:08 PM
rthomsen retitled this revision from to Add support for LZ4-compressed tar archives.
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to R36 Ark.
rthomsen added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptJun 10 2016, 4:08 PM
rthomsen updated this revision to Diff 4335.Jun 10 2016, 4:16 PM

Forgot to check for lz4 executable in PluginManager::supportedMimeTypes() and PluginManager::supportedWriteMimeTypes().

rthomsen updated this object.Jun 12 2016, 12:46 PM
rthomsen updated this revision to Diff 4357.Jun 12 2016, 6:01 PM

Enable support for "application/x-lz4-compressed-tar" in libarchive plugin depending on installed libarchive version.

rthomsen updated this revision to Diff 4358.Jun 12 2016, 6:10 PM

Use OR when evaluating libarchive version.

rthomsen updated this revision to Diff 4359.Jun 12 2016, 6:36 PM

Use target_compile_definitions() in cmake to set a #define in cpp file for libarchive plugin. This is needed to disable code which requires libarchive 3.2.0 on older versions.

elvisangelaccio requested changes to this revision.Jun 13 2016, 11:15 AM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
plugins/libarchive/CMakeLists.txt
9

This if() is always going to be true, since libarchive is a required dep. So you can drop it (same for all the if()s below)

79

This can be moved in the previous if().

This revision now requires changes to proceed.Jun 13 2016, 11:15 AM
rthomsen updated this revision to Diff 4595.Jun 17 2016, 8:56 PM
rthomsen edited edge metadata.

Don't check whether libarchive was found since it's a required dependency.

rthomsen marked an inline comment as done.Jun 17 2016, 8:58 PM
rthomsen added inline comments.
plugins/libarchive/CMakeLists.txt
79

The target_compile_definitions() call needs to be after the add_library() call.

rthomsen marked 2 inline comments as done.Jun 17 2016, 8:58 PM
elvisangelaccio accepted this revision.Jun 18 2016, 4:02 PM
elvisangelaccio edited edge metadata.

I still don't have libarchive 3.2, but I'm sure this patch works fine ;)

This revision is now accepted and ready to land.Jun 18 2016, 4:02 PM
This revision was automatically updated to reflect the committed changes.