]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Actually copy files to the right place
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 22:20:37 +0000 (22:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 22:33:30 +0000 (22:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/repo.c

index 516d905cde7765cbdc70eca98d9603c9e271efcd..5dae617cf4c26d0eccff5e06fad8c231216664e9 100644 (file)
@@ -444,7 +444,6 @@ int __pakfire_repo_make_path(struct pakfire_repo* self, char* path, size_t lengt
 int pakfire_repo_import_archive(struct pakfire_repo* self,
                struct pakfire_archive* archive, struct pakfire_package** package) {
        struct pakfire_package* pkg = NULL;
-       char path[PATH_MAX];
        int r;
 
        // This only works on internal or local repositories
@@ -458,11 +457,11 @@ int pakfire_repo_import_archive(struct pakfire_repo* self,
 
        // Fetch package path
        const char* arc_path = pakfire_archive_get_path(archive);
-       const char* pkg_path = pakfire_package_get_path(pkg);
+       const char* pkg_path = pakfire_package_get_string(pkg, PAKFIRE_PKG_PATH);
 
        // Copy (or link) the archive
        if (!pakfire_string_equals(arc_path, pkg_path)) {
-               r = pakfire_archive_link_or_copy(archive, path);
+               r = pakfire_archive_link_or_copy(archive, pkg_path);
                if (r < 0)
                        goto ERROR;
        }