]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
file: Implement detecting static libraries and libtool archives
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Feb 2023 16:28:55 +0000 (16:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Feb 2023 16:28:55 +0000 (16:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c
src/libpakfire/include/pakfire/file.h

index d6f748a30cde9af38a9a0e838c32f76e94a00101..c57928add2209a3ab08601978be3410c4dbbb483 100644 (file)
@@ -949,6 +949,8 @@ static const struct extension {
        const char* extension;
        int class;
 } extensions[] = {
+       { "*.a",  PAKFIRE_FILE_STATIC_LIBRARY },
+       { "*.la", PAKFIRE_FILE_LIBTOOL_ARCHIVE },
        { "*.pm", PAKFIRE_FILE_PERL },
        { "*.pc", PAKFIRE_FILE_PKGCONFIG },
        { NULL , 0 },
index 4eef5334cb65ca3258a83c06008650f8f4635536..0dd1a9a1e1e4b9953e2b677fea82412c11180529 100644 (file)
@@ -92,21 +92,23 @@ int pakfire_file_matches(struct pakfire_file* file, const char* pattern);
 #include <archive_entry.h>
 
 enum pakfire_file_classes {
-       PAKFIRE_FILE_UNKNOWN      = 0,
+       PAKFIRE_FILE_UNKNOWN         = 0,
 
        // Simple types
-       PAKFIRE_FILE_REGULAR      = (1 << 0),
-       PAKFIRE_FILE_DIRECTORY    = (1 << 1),
-       PAKFIRE_FILE_SYMLINK      = (1 << 2),
-       PAKFIRE_FILE_CHARACTER    = (1 << 3),
-       PAKFIRE_FILE_BLOCK        = (1 << 4),
-       PAKFIRE_FILE_FIFO         = (1 << 5),
-       PAKFIRE_FILE_SOCKET       = (1 << 6),
+       PAKFIRE_FILE_REGULAR         = (1 << 0),
+       PAKFIRE_FILE_DIRECTORY       = (1 << 1),
+       PAKFIRE_FILE_SYMLINK         = (1 << 2),
+       PAKFIRE_FILE_CHARACTER       = (1 << 3),
+       PAKFIRE_FILE_BLOCK           = (1 << 4),
+       PAKFIRE_FILE_FIFO            = (1 << 5),
+       PAKFIRE_FILE_SOCKET          = (1 << 6),
 
        // The rest
-       PAKFIRE_FILE_EXECUTABLE   = (1 << 7),
-       PAKFIRE_FILE_PKGCONFIG    = (1 << 8),
-       PAKFIRE_FILE_PERL         = (1 << 9),
+       PAKFIRE_FILE_EXECUTABLE      = (1 << 7),
+       PAKFIRE_FILE_PKGCONFIG       = (1 << 8),
+       PAKFIRE_FILE_PERL            = (1 << 9),
+       PAKFIRE_FILE_STATIC_LIBRARY  = (1 << 10),
+       PAKFIRE_FILE_LIBTOOL_ARCHIVE = (1 << 11),
 };
 
 int pakfire_file_create_from_path(struct pakfire_file** file,