}
struct archive_entry* pakfire_file_archive_entry(struct pakfire_file* file, int digest_types) {
+ const char* path = NULL;
+
struct archive_entry* entry = archive_entry_new();
if (!entry) {
ERROR(file->pakfire, "Could not allocate archive entry: %m\n");
archive_entry_copy_sourcepath(entry, file->abspath);
// Set path
- archive_entry_copy_pathname(entry, pakfire_file_get_path(file));
+ path = pakfire_file_get_path(file);
+ if (path && *path == '/') {
+ archive_entry_copy_pathname(entry, path + 1);
+ }
// Set links
if (*file->hardlink)