]> git.ipfire.org Git - pakfire.git/commitdiff
packager: Set the sourcepath as path if no path given
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Aug 2023 09:46:58 +0000 (09:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Aug 2023 09:46:58 +0000 (09:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/packager.c

index 17b8669a2ff5e2f96b359030b455fba4c2f8290b..b3078d1c2de6216cbf178d13e388c98013186f13 100644 (file)
@@ -618,12 +618,13 @@ int pakfire_packager_add(struct pakfire_packager* packager,
        if (r)
                goto ERROR;
 
+       if (!path)
+               path = sourcepath;
+
        // Assign a new path for inside the archive
-       if (path) {
-               r = pakfire_file_set_path(file, path);
-               if (r)
-                       goto ERROR;
-       }
+       r = pakfire_file_set_path(file, path);
+       if (r)
+               goto ERROR;
 
        // Call the main function
        r = pakfire_packager_add_file(packager, file);