]> git.ipfire.org Git - pakfire.git/commitdiff
file: Remove the remainder of the file checks
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Oct 2024 17:34:30 +0000 (17:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Oct 2024 17:34:30 +0000 (17:34 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c
src/libpakfire/file.c
src/libpakfire/include/pakfire/file.h

index cbc25a789f92c1674eaf72d2d4871e0ef20f2f1e..f796b0bd032f68771ff2b816b3c895b672ec312a 100644 (file)
@@ -1098,7 +1098,7 @@ static int pakfire_build_post_process_files(struct pakfire_build* build,
                        INFO(build->ctx, "%s\n", description);
 
                // Show all files which will be removed
-               pakfire_filelist_dump(removees, PAKFIRE_FILE_DUMP_FULL|PAKFIRE_FILE_DUMP_ISSUES);
+               pakfire_filelist_dump(removees, PAKFIRE_FILE_DUMP_FULL);
 
                // Remove all files on the removee list
                if (flags & PAKFIRE_BUILD_CLEANUP_FILES) {
@@ -1213,39 +1213,6 @@ static int pakfire_build_post_check_broken_symlinks(
        File Issues
 */
 
-static int __pakfire_build_post_check_files(
-               struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) {
-       struct pakfire_filelist* broken = (struct pakfire_filelist*)data;
-       int issues = 0;
-       int r;
-
-       // Check file for issues
-       r = pakfire_file_check(file, &issues);
-       if (r) {
-               //BUILD_ERROR(build, "%s: File Check failed: %m\n", pakfire_file_get_path(file));
-               return r;
-       }
-
-       // If any issues have been found, consider this file to be on the list
-       if (issues) {
-               r = pakfire_filelist_add(broken, file);
-               if (r)
-                       return r;
-       }
-
-       return 0;
-}
-
-static int pakfire_build_post_check_files(
-               struct pakfire_build* build, struct pakfire_filelist* filelist) {
-       return pakfire_build_post_process_files(
-               build,
-               filelist,
-               "File Issues:",
-               __pakfire_build_post_check_files,
-               PAKFIRE_BUILD_ERROR_IF_NOT_EMPTY|PAKFIRE_BUILD_SHOW_PROGRESS);
-}
-
 static int pakfire_build_run_post_build_checks(struct pakfire_build* build) {
        struct pakfire_filelist* filelist = NULL;
        int r;
@@ -1284,11 +1251,6 @@ static int pakfire_build_run_post_build_checks(struct pakfire_build* build) {
        if (r)
                goto ERROR;
 
-       // Check files
-       r = pakfire_build_post_check_files(build, filelist);
-       if (r)
-               goto ERROR;
-
 ERROR:
        if (filelist)
                pakfire_filelist_unref(filelist);
index d28a0de874ccf07d5d192dfc030e56052591dfea..56f1137ed4982d4ed61663bc54444319c346537b 100644 (file)
@@ -38,7 +38,6 @@
 #include <pakfire/ctx.h>
 #include <pakfire/constants.h>
 #include <pakfire/digest.h>
-#include <pakfire/fhs.h>
 #include <pakfire/file.h>
 #include <pakfire/logging.h>
 #include <pakfire/pakfire.h>
@@ -747,35 +746,6 @@ char* pakfire_file_dump(struct pakfire_file* file, int flags) {
                }
        }
 
-       // Dump Issues
-       if (flags & PAKFIRE_FILE_DUMP_ISSUES) {
-               if (file->issues & PAKFIRE_FILE_FHS_ERROR) {
-                       r = asprintf(&buffer, "%s [FHS-ERROR]", buffer);
-                       if (r < 0)
-                               goto ERROR;
-               }
-
-               if (file->issues & PAKFIRE_FILE_MISSING_DEBUGINFO) {
-                       r = asprintf(&buffer, "%s [MISSING-DEBUGINFO]", buffer);
-                       if (r < 0)
-                               goto ERROR;
-               }
-
-               // Invalid capabilities
-               if (file->issues & PAKFIRE_FILE_INVALID_CAPS) {
-                       r = asprintf(&buffer, "%s [INVALID-CAPS]", buffer);
-                       if (r < 0)
-                               goto ERROR;
-               }
-
-               // Invalid interpreters
-               if (file->issues & PAKFIRE_FILE_INVALID_INTERPRETER) {
-                       r = asprintf(&buffer, "%s [INVALID-INTERPRETER]", buffer);
-                       if (r < 0)
-                               goto ERROR;
-               }
-       }
-
        return buffer;
 
 ERROR:
@@ -1788,24 +1758,3 @@ PAKFIRE_EXPORT int pakfire_file_matches(struct pakfire_file* file, const char* p
 
        return pakfire_path_match(pattern, path);
 }
-
-int pakfire_file_check(struct pakfire_file* file, int* issues) {
-       int r;
-
-       // Return previous result if this has been run before
-       if (!file->check_done) {
-               // Perform FHS check
-               r = pakfire_fhs_check_file(file->ctx, file);
-               if (r)
-                       file->issues |= PAKFIRE_FILE_FHS_ERROR;
-
-               // All checks done
-               file->check_done = 1;
-       }
-
-       // Return any issues
-       if (issues)
-               *issues = file->issues;
-
-       return 0;
-}
index 46d04f7efd3aaed8f4fe06517f56998ac83c181d..fd4a27267f8462592cd2174d88b03cf53d5e7b71 100644 (file)
@@ -147,7 +147,6 @@ enum pakfire_file_dump_flags {
        PAKFIRE_FILE_DUMP_TIME         = (1 << 2),
        PAKFIRE_FILE_DUMP_OWNERSHIP    = (1 << 3),
        PAKFIRE_FILE_DUMP_LINK_TARGETS = (1 << 4),
-       PAKFIRE_FILE_DUMP_ISSUES       = (1 << 5),
 
        PAKFIRE_FILE_DUMP_FULL = \
                PAKFIRE_FILE_DUMP_MODE | \
@@ -183,18 +182,5 @@ int pakfire_file_matches_class(struct pakfire_file* file, const int class);
 
 int pakfire_file_verify(struct pakfire_file* file, int* status);
 
-/*
-       Checks
-*/
-enum pakfire_file_check_issues {
-       PAKFIRE_FILE_FHS_ERROR           = (1 << 0),
-       PAKFIRE_FILE_MISSING_DEBUGINFO   = (1 << 1),
-       PAKFIRE_FILE_INVALID_CAPS        = (1 << 7),
-       PAKFIRE_FILE_INVALID_INTERPRETER = (1 << 8),
-};
-
-int pakfire_file_check(struct pakfire_file* file, int* issues);
-
-#endif
-
+#endif /* PAKFIRE_PRIVATE */
 #endif /* PAKFIRE_FILE_H */