From: Michael Tremer Date: Thu, 1 Sep 2022 18:03:35 +0000 (+0000) Subject: compress: Move filelist argument into extractor struct X-Git-Tag: 0.9.28~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d05af3bad9a106c2326a1b9f5cc992c423155dce;p=pakfire.git compress: Move filelist argument into extractor struct Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/compress.c b/src/libpakfire/compress.c index de311a6c9..c05a53803 100644 --- a/src/libpakfire/compress.c +++ b/src/libpakfire/compress.c @@ -530,6 +530,9 @@ struct pakfire_extract { // The archive to extract struct archive* archive; + // The filelist of all extracted files + struct pakfire_filelist* filelist; + // Prepend this prefix char prefix[PATH_MAX]; @@ -588,7 +591,7 @@ static void pakfire_extract_progress(void* p) { } static int __pakfire_extract_entry(struct pakfire* pakfire, struct pakfire_extract* data, - struct archive_entry* entry, struct pakfire_filelist* filelist) { + struct archive_entry* entry) { struct pakfire_file* file = NULL; char buffer[PATH_MAX]; int r; @@ -623,13 +626,13 @@ static int __pakfire_extract_entry(struct pakfire* pakfire, struct pakfire_extra } // Add entry to filelist (if requested) - if (filelist) { + if (data->filelist) { r = pakfire_file_create_from_archive_entry(&file, pakfire, entry); if (r) goto ERROR; // Append the file to the list - r = pakfire_filelist_append(filelist, file); + r = pakfire_filelist_append(data->filelist, file); if (r) goto ERROR; } @@ -671,10 +674,11 @@ int pakfire_extract(struct pakfire* pakfire, struct archive* archive, int r = 1; struct pakfire_extract data = { - .pakfire = pakfire, - .archive = archive, - .flags = flags, - .writer = NULL, + .pakfire = pakfire, + .archive = archive, + .filelist = filelist, + .flags = flags, + .writer = NULL, }; // Is this a dry run? @@ -732,7 +736,7 @@ int pakfire_extract(struct pakfire* pakfire, struct archive* archive, } // Extract the entry - r = __pakfire_extract_entry(pakfire, &data, entry, filelist); + r = __pakfire_extract_entry(pakfire, &data, entry); if (r) goto ERROR; }