[Rpm-maint] [rpm-software-management/rpm] Avoid libmagic calculation for source files (PR #1951)
Stephan Kulow
notifications at github.com
Wed Mar 16 15:16:58 UTC 2022
@coolo commented on this pull request.
> -
- /* XXX all files with extension ".la" are libtool for now. */
- else if (rpmFileHasSuffix(s, ".la"))
- ftype = "libtool library file";
-
- /* XXX all files with extension ".pc" are pkgconfig for now. */
- else if (rpmFileHasSuffix(s, ".pc"))
- ftype = "pkgconfig file";
+ /* Skip libmagic for some well known file extensions. To avoid the
+ costly calculcation but also to have a stable output for some */
+ while (skipped_extensions[extension_index]) {
+ if (rpmFileHasSuffix(s, skipped_extensions[extension_index++])) {
+ ftype = skipped_extensions[extension_index++];
+ fmime = skipped_extensions[extension_index++];
+ } else {
+ extension_index += 2;
I updated this now to use a struct, but somehow github struggles to update the PR. I hope this resolves soonish, otherwise I'll create a new PR
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1951#discussion_r828126129
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/1951/review/911798329 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220316/9b9ddc6f/attachment.html>
More information about the Rpm-maint
mailing list