struct archive* mtree;
FILE* fmtree;
size_t installsize;
+ unsigned int files;
struct pakfire_scriptlet** scriptlets;
unsigned int num_scriptlets;
}
// Write the filelist in mtree format
- r = pakfire_packager_write_archive(packager, a, mtree, "filelist",
- &packager->mtree, packager->fmtree);
- if (r) {
- ERROR(packager->pakfire, "Could not add filelist to archive: %s\n",
- archive_error_string(a));
- goto ERROR;
- }
+ if (packager->files) {
+ r = pakfire_packager_write_archive(packager, a, mtree, "filelist",
+ &packager->mtree, packager->fmtree);
+ if (r) {
+ ERROR(packager->pakfire, "Could not add filelist to archive: %s\n",
+ archive_error_string(a));
+ goto ERROR;
+ }
- // Write the payload
- r = pakfire_packager_write_archive(packager, a, mtree, "data.img",
- &packager->payload, packager->fpayload);
- if (r) {
- ERROR(packager->pakfire, "Could not add payload to archive: %s\n",
- archive_error_string(a));
- goto ERROR;
+ // Write the payload
+ r = pakfire_packager_write_archive(packager, a, mtree, "data.img",
+ &packager->payload, packager->fpayload);
+ if (r) {
+ ERROR(packager->pakfire, "Could not add payload to archive: %s\n",
+ archive_error_string(a));
+ goto ERROR;
+ }
}
// Write scriptlets
// Increment installsize
packager->installsize += archive_entry_size(entry);
+ // Increment file counter
+ packager->files++;
+
// Successful
r = 0;