// The archive to extract
struct archive* archive;
+ // The filelist of all extracted files
+ struct pakfire_filelist* filelist;
+
// Prepend this prefix
char prefix[PATH_MAX];
}
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;
}
// 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;
}
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?
}
// Extract the entry
- r = __pakfire_extract_entry(pakfire, &data, entry, filelist);
+ r = __pakfire_extract_entry(pakfire, &data, entry);
if (r)
goto ERROR;
}