Bug 438186

Summary: kfilemetadata: Executable ExternalExtractors are ignored, contrary to the documentation.
Product: [Frameworks and Libraries] frameworks-kfilemetadata Reporter: Pat Thoyts <pat.thoyts>
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED FIXED    
Severity: normal CC: stefan.bruens
Priority: NOR    
Version First Reported In: 5.82.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pat Thoyts 2021-06-06 21:02:31 UTC
SUMMARY

Commit 73da9a53cb added code to extractorcollection.cpp that skips files that are not libraries. However, this library is supposed to support executable files in the libexec/kf5/kfilemetadata/externalextractors subdirectories. The commit mentioned above skips all such files so no executable external extractor is ever recognised. Inverting the logic when checking for external extractors (line 114) enables the use of such executable files

STEPS TO REPRODUCE
1. Create a folder under libexec/kf5/kfilemetadata/externalextractors (eg testextractor) and add a manifest.json and an executable shell script or python program.
2. Run QT_LOGGING_RULES="*.debug=true" ./bin/dump path/to/some/file
3. Look for the output of the extractor or for it to have been located in the debug output 

OBSERVED RESULT

The external extractor is not found and not called.

EXPECTED RESULT

The external extractor is called as documented.

SOFTWARE/OS VERSIONS
Windows: not tested
macOS: not tested
Linux/KDE Plasma: KDE neon User Edition 5.21
(available in About System)
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION

Probably broken since 5.76.0 but I've only tested 5.82.0
Comment 1 Bug Janitor Service 2021-06-06 21:13:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/29