return r;
}
+struct archive_entry* pakfire_file_archive_entry(struct pakfire_file* file) {
+ struct archive_entry* entry = archive_entry_new();
+ if (!entry) {
+ ERROR(file->pakfire, "Could not allocate archive entry: %m\n");
+ return NULL;
+ }
+
+ // Set path
+ archive_entry_copy_pathname(entry, pakfire_file_get_path(file));
+
+ // Set source path
+ archive_entry_copy_sourcepath(entry, file->abspath);
+
+ // Set links
+ if (*file->hardlink)
+ archive_entry_set_hardlink(entry, file->hardlink);
+ if (*file->symlink)
+ archive_entry_set_symlink(entry, file->symlink);
+
+ // Set size
+ archive_entry_set_size(entry, pakfire_file_get_size(file));
+
+ // Set mode
+ archive_entry_set_mode(entry, pakfire_file_get_mode(file));
+
+ // Set user
+ archive_entry_set_uname(entry, pakfire_file_get_user(file));
+
+ // Set group
+ archive_entry_set_gname(entry, pakfire_file_get_group(file));
+
+ // Set times
+ archive_entry_set_ctime(entry, pakfire_file_get_ctime(file), 0);
+ archive_entry_set_mtime(entry, pakfire_file_get_mtime(file), 0);
+
+ // XXX copy digest
+
+ return entry;
+}
+
static void pakfire_file_free(struct pakfire_file* file) {
struct pakfire_file_digest* digest = NULL;
int pakfire_file_create_from_archive_entry(struct pakfire_file** file, struct pakfire* pakfire,
struct archive_entry* entry);
int pakfire_file_copy_archive_entry(struct pakfire_file* file, struct archive_entry* entry);
+struct archive_entry* pakfire_file_archive_entry(struct pakfire_file* file);
const char* pakfire_file_get_abspath(struct pakfire_file* file);
int pakfire_file_set_abspath(struct pakfire_file* file, const char* path);