]> git.ipfire.org Git - pakfire.git/commitdiff
build: Use simpler function to add files
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Aug 2022 16:23:01 +0000 (16:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Aug 2022 16:23:01 +0000 (16:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c
src/libpakfire/include/pakfire/packager.h
src/libpakfire/packager.c

index b24d7732768a29672d3dc05d74e63de7e3c62af6..6b684a4272a2ae3f1deef3cf9d9b581c3b1f9252 100644 (file)
@@ -354,11 +354,7 @@ static int pakfire_build_package_add_files(struct pakfire_build* build,
                struct pakfire_file* file = pakfire_filelist_get(filelist, i);
 
                // Add the file to the package
-               r = pakfire_packager_add(
-                       packager,
-                       pakfire_file_get_abspath(file),
-                       pakfire_file_get_path(file)
-               );
+               r = pakfire_packager_add_file(packager, file);
                if (r) {
                        pakfire_file_unref(file);
                        goto ERROR;
index 5e147a76e9169519a22ef7dc58e04a2e7519a2ff..dad1b90f29f40ee0c1295283001e886bb87eba3c 100644 (file)
@@ -23,6 +23,7 @@
 
 #ifdef PAKFIRE_PRIVATE
 
+#include <pakfire/file.h>
 #include <pakfire/package.h>
 #include <pakfire/scriptlet.h>
 
@@ -40,6 +41,8 @@ int pakfire_packager_finish(struct pakfire_packager* packager, FILE* f);
 int pakfire_packager_finish_to_directory(struct pakfire_packager* packager,
        const char* target, char** result);
 
+int pakfire_packager_add_file(
+       struct pakfire_packager* packager, struct pakfire_file* file);
 int pakfire_packager_add(struct pakfire_packager* packager,
        const char* sourcepath, const char* path);
 
index 0e4fa45ea6dc3b931b6ea9e2ea5c612e14bd87f1..d8148def7e383b5f0e991800252e12b2cc0ce12a 100644 (file)
@@ -640,8 +640,7 @@ ERROR:
        return r;
 }
 
-static int pakfire_packager_add_file(struct pakfire_packager* packager,
-               struct pakfire_file* file) {
+int pakfire_packager_add_file(struct pakfire_packager* packager, struct pakfire_file* file) {
        struct archive_entry* entry = NULL;
        FILE* f = NULL;
        int r;