]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
build: Pass context to pakfire_build_package_add_files
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Aug 2022 17:05:17 +0000 (17:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Aug 2022 17:05:17 +0000 (17:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c

index 59728da3d4fc500a3a26e5a1584f836f1028e8b8..a03ba126b2a2e23ee54e91effe636a74542425ea 100644 (file)
@@ -269,9 +269,9 @@ static int append_to_array(const char*** array, const char* s) {
        return 0;
 }
 
-static int pakfire_build_package_add_files(struct pakfire* pakfire, struct pakfire_parser* makefile,
-               const char* buildroot, const char* namespace, struct pakfire_package* pkg,
-               struct pakfire_packager* packager) {
+static int pakfire_build_package_add_files(struct pakfire_build* build,
+               struct pakfire_parser* makefile, const char* buildroot, const char* namespace,
+               struct pakfire_package* pkg, struct pakfire_packager* packager) {
        struct pakfire_filelist* filelist = NULL;
        char path[PATH_MAX];
        int r = 1;
@@ -288,7 +288,7 @@ static int pakfire_build_package_add_files(struct pakfire* pakfire, struct pakfi
                return 0;
 
        // Convert to absolute path
-       pakfire_make_path(pakfire, path, buildroot);
+       pakfire_make_path(build->pakfire, path, buildroot);
 
        // Split into includes and excludes
        for (char** file = files; *file; file++) {
@@ -301,7 +301,7 @@ static int pakfire_build_package_add_files(struct pakfire* pakfire, struct pakfi
        }
 
        // Allocate a new filelist
-       r = pakfire_filelist_create(&filelist, pakfire);
+       r = pakfire_filelist_create(&filelist, build->pakfire);
        if (r)
                goto ERROR;
 
@@ -311,16 +311,16 @@ static int pakfire_build_package_add_files(struct pakfire* pakfire, struct pakfi
                goto ERROR;
 
        const size_t length = pakfire_filelist_size(filelist);
-       DEBUG(pakfire, "%zu file(s) found\n", length);
+       DEBUG(build->pakfire, "%zu file(s) found\n", length);
 
        // Nothing to do if the filelist is empty
        if (!length)
                goto ERROR;
 
        // Find dependencies
-       r = pakfire_build_find_dependencies(pakfire, pkg, filelist, buildroot);
+       r = pakfire_build_find_dependencies(build->pakfire, pkg, filelist, buildroot);
        if (r) {
-               ERROR(pakfire, "Finding dependencies failed: %m\n");
+               ERROR(build->pakfire, "Finding dependencies failed: %m\n");
                goto ERROR;
        }
 
@@ -555,7 +555,7 @@ static int pakfire_build_package(struct pakfire_build* build, struct pakfire_par
                goto ERROR;
 
        // Add files
-       r = pakfire_build_package_add_files(build->pakfire, makefile, buildroot, namespace,
+       r = pakfire_build_package_add_files(build, makefile, buildroot, namespace,
                pkg, packager);
        if (r)
                goto ERROR;