const char* path = archive_entry_pathname(entry);
+ DEBUG(pakfire, "Reading metadata file: %s\n", path);
+
// Load the file into memory
r = pakfire_archive_copy_data_to_buffer(archive->pakfire, a, entry, &data, &length);
if (r) {
if (archive->format >= 6) {
// Anything that starts with "." is a metadata file
if (*path == '.')
- return ARCHIVE_OK;
+ return PAKFIRE_WALK_OK;
// Otherwise, the payload begins
- return ARCHIVE_EOF;
+ return PAKFIRE_WALK_DONE;
// Format >= 1
} else if (archive->format >= 1) {
// info
if (strcmp(path, "info") == 0)
- return ARCHIVE_OK;
+ return PAKFIRE_WALK_OK;
// scriptlets
else if (pakfire_string_startswith(path, "scriptlets/"))
- return ARCHIVE_OK;
+ return PAKFIRE_WALK_OK;
// Ignore anything else
- return ARCHIVE_RETRY;
+ return PAKFIRE_WALK_SKIP;
// The pakfire-format file is part of the metadata
} else if (strcmp(path, "pakfire-format") == 0) {
- return ARCHIVE_OK;
+ return PAKFIRE_WALK_OK;
}
// Unknown file
- return 1;
+ return PAKFIRE_WALK_ERROR;
}
static int pakfire_archive_read_metadata(struct pakfire_archive* archive) {
int r;
+ DEBUG(archive->pakfire, "Reading archive metadata...\n");
+
// Walk through the archive
r = pakfire_archive_walk(archive, __pakfire_archive_read_metadata,
- __pakfire_archive_filter_metadata, NULL);
+ __pakfire_archive_filter_metadata, archive);
if (r)
return r;
pakfire_walk_callback callback, pakfire_walk_filter_callback filter_callback,
void* p) {
struct archive_entry* entry = NULL;
+ const char* path = NULL;
int r;
// Walk through the archive
return r;
}
+ path = archive_entry_pathname(entry);
+
+ DEBUG(pakfire, "Walking through %s...\n", path);
+
// Call the filter callback before we call the actual callback
if (filter_callback) {
r = filter_callback(pakfire, archive, entry, p);
// Raise any other errors
default:
- DEBUG(pakfire, "Filter callback received an error: %d\n", r);
+ DEBUG(pakfire, "Filter callback returned an error: %d\n", r);
return r;
}
}