// Fetch path
const char* path = archive_entry_pathname(entry);
+ // Make sure we have a leading slash on the filelist
+ if (!pakfire_string_startswith(path, "/")) {
+ r = pakfire_string_format(buffer, "/%s", path);
+ if (r)
+ goto ERROR;
+
+ // Store the new name
+ archive_entry_set_pathname(entry, buffer);
+
+ // Update the path pointer
+ path = archive_entry_pathname(entry);
+ }
+
// Generate a file object
r = pakfire_file_create_from_archive_entry(&file, pakfire, entry);
if (r)
FILE* f = NULL;
int r;
+ const char* path = archive_entry_pathname(entry);
+
+ // Remove any leading slahes
+ while (*path == '/')
+ path++;
+
+ archive_entry_set_pathname(entry, path);
+
// Write the header
r = archive_write_header(data->archive, entry);
if (r) {
return r;
}
- pakfire_string_format(archive_path, "/files/%s", filename);
+ r = pakfire_string_format(archive_path, "files/%s", filename);
+ if (r)
+ return r;
// Add file to package
return pakfire_packager_add(packager, cache_path, archive_path);