Check whether tar.lzo format is available
ClosedPublic

Authored by elvisangelaccio on Feb 26 2017, 12:47 PM.

Details

Summary

libarchive >= 3.3 no longer links to liblzo2 automatically, and falls back on
the lzop executable instead. This means we need to check at runtime whether
libarchive has been built against liblzo. If not, we look for the lzop
executable.

Test Plan

extracttest and loadtest no longer fail with libarchive 3.3 + lzop not
installed. Also, tar.lzo mimetype is now listed in CreateDialog in such cases.

Diff Detail

Repository
R36 Ark
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Restricted Application added a project: Ark. · View Herald TranscriptFeb 26 2017, 12:47 PM
Restricted Application added subscribers: Ark, kde-utils-devel. · View Herald Transcript
rthomsen added inline comments.Feb 26 2017, 2:12 PM
kerfuffle/pluginmanager.cpp
261–264

Do we need to check in /usr/local/lib{,64} as well?

ltoscano added inline comments.
kerfuffle/pluginmanager.cpp
261–264

And /usr/lib/<arch-triplet>/ too

ltoscano added inline comments.Feb 26 2017, 2:20 PM
kerfuffle/pluginmanager.cpp
261–264

This could be a can of worms (think about possible local installation path, or other OSs...)

kerfuffle/pluginmanager.cpp
261–264

Right, hardcoding the path is not going to scale, I need to find a way to automatically get the path that will be used...

  • Don't hardcode absolute path, use ldd to figure out the actual libarchive path instead.
  • Don't just look in the first library path, iterate over all of them until a plugin is found.
elvisangelaccio marked 4 inline comments as done.Feb 26 2017, 7:03 PM
rthomsen accepted this revision.Feb 26 2017, 7:05 PM

Looks good to me :)

This revision is now accepted and ready to land.Feb 26 2017, 7:05 PM
elvisangelaccio edited the test plan for this revision. (Show Details)Feb 27 2017, 5:26 PM
This revision was automatically updated to reflect the committed changes.