]> git.ipfire.org Git - pakfire.git/commitdiff
build: Drop old code that copies the packages after build
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Jan 2025 15:04:11 +0000 (15:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Jan 2025 15:04:11 +0000 (15:04 +0000)
This is broken and needs to be replaced by something more custom.

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

index 46146e5b7dcdbe1670513b51bcbf2c8c655e6dea..33fd64fee4e950a7eb39a81b48085de05e710e3f 100644 (file)
@@ -2304,86 +2304,6 @@ static int pakfire_build_post_check(struct pakfire_build* build) {
        return 0;
 }
 
-static int pakfire_build_copy_package(struct pakfire_ctx* ctx,
-               struct pakfire_package* pkg, void* data) {
-       struct pakfire_archive* archive = NULL;
-       const char* target = data;
-       char path[PATH_MAX];
-       int r;
-
-       // Check inputs
-       if (!target)
-               return -EINVAL;
-
-       // Fetch NEVRA
-       const char* nevra = pakfire_package_get_string(pkg, PAKFIRE_PKG_NEVRA);
-
-       // Fetch the package filename
-       const char* filename = pakfire_package_get_string(pkg, PAKFIRE_PKG_FILENAME);
-       if (!filename)
-               return -EINVAL;
-
-       // Format the destination path
-       r = pakfire_string_format(path, "%s/%s", target, filename);
-       if (r < 0)
-               goto ERROR;
-
-       // Open the archive
-       archive = pakfire_package_get_archive(pkg);
-       if (!archive) {
-               r = 1;
-               goto ERROR;
-       }
-
-       // Copy it to its destination
-       r = pakfire_archive_link_or_copy(archive, path);
-       if (r < 0) {
-               ERROR(ctx, "Could not write %s to %s: %s\n", nevra, path, strerror(-r));
-               goto ERROR;
-       }
-
-ERROR:
-       if (archive)
-               pakfire_archive_unref(archive);
-
-       return r;
-}
-
-static int pakfire_build_copy_packages(struct pakfire_build* build) {
-       struct pakfire_repo* local = NULL;
-       int r = 0;
-
-       DEBUG(build->ctx, "Copying built packages\n");
-
-       // Fetch local repository
-       local = pakfire_get_repo(build->pakfire, PAKFIRE_REPO_LOCAL);
-
-       // Copy all packages to the target path
-       if (*build->target) {
-               r = pakfire_repo_walk_packages(build->repo,
-                               pakfire_build_copy_package, build->target, 0);
-               if (r < 0)
-                       goto ERROR;
-       }
-
-       // If we have a local repository, we copy all packages to it
-       if (local) {
-               const char* path = pakfire_repo_get_path(local);
-               if (path) {
-                       r = pakfire_repo_walk_packages(build->repo,
-                                       pakfire_build_copy_package, (char*)path, 0);
-                       if (r < 0)
-                               goto ERROR;
-               }
-       }
-
-ERROR:
-       if (local)
-               pakfire_repo_unref(local);
-
-       return r;
-}
-
 static int pakfire_build_init(struct pakfire_build* build,
                struct pakfire_package* package, const char** packages) {
        struct pakfire_transaction* transaction = NULL;