]> git.ipfire.org Git - pakfire.git/commitdiff
build: Remove BUILDROOT check
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jul 2023 10:16:54 +0000 (10:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jul 2023 10:16:54 +0000 (10:16 +0000)
This searched for any references to BUILDROOT in any generated files.
However, this is hard to implement without using the nested function
which unfortunately requires an executable stack which is not permitted
in IPFire.

Since the check is usually not having a massive impact, this patch
removes it for now with the intention to bring it back at a later time.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c

index 963149e2112a39e07c8ee232e8312198a83169be..28c6ad796a24b678e5e47554e92d05b203905e2f 100644 (file)
@@ -1174,42 +1174,6 @@ static int pakfire_build_post_check_broken_symlinks(
                PAKFIRE_BUILD_ERROR_IF_NOT_EMPTY);
 }
 
-/*
-       BUILDROOT Check
-*/
-static int pakfire_build_post_check_buildroot(
-               struct pakfire_build* build, struct pakfire_filelist* filelist) {
-       const char* buildroot = pakfire_relpath(build->pakfire, build->buildroot);
-
-       // Nested function to keep a reference to buildroot
-       int __pakfire_build_post_check_buildroot(
-                       struct pakfire* pakfire, struct pakfire_file* file, void* data) {
-               struct pakfire_filelist* matches = (struct pakfire_filelist*)data;
-               int r;
-
-               // Fetch the path
-               const char* path = pakfire_file_get_path(file);
-               if (!path)
-                       return 1;
-
-               // Do not run this for Python bytecode files
-               if (pakfire_path_match("**.pyc", path))
-                       return 0;
-
-               if (pakfire_file_payload_matches(file, buildroot, strlen(buildroot))) {
-                       r = pakfire_filelist_add(matches, file);
-                       if (r)
-                               return r;
-               }
-
-               return 0;
-       }
-
-       return pakfire_build_post_process_files(
-               build, filelist, "Files containing BUILDROOT:",
-               __pakfire_build_post_check_buildroot, PAKFIRE_BUILD_ERROR_IF_NOT_EMPTY);
-}
-
 /*
        File Issues
 */
@@ -1285,11 +1249,6 @@ static int pakfire_build_run_post_build_checks(struct pakfire_build* build) {
        if (r)
                goto ERROR;
 
-       // Check for BUILDROOT
-       r = pakfire_build_post_check_buildroot(build, filelist);
-       if (r)
-               goto ERROR;
-
        // Check files
        r = pakfire_build_post_check_files(build, filelist);
        if (r)