static int pakfire_db_load_file(struct pakfire_db* db, struct pakfire_filelist* filelist,
sqlite3_stmt* stmt) {
struct pakfire_file* file = NULL;
+ char abspath[PATH_MAX];
int r;
// Create a new file object
goto ERROR;
}
+ // Make the absolute path
+ r = pakfire_path(db->pakfire, abspath, "%s", path);
+ if (r) {
+ ERROR(db->pakfire, "%s: Could not make absolute path: %m\n", path);
+ goto ERROR;
+ }
+
+ // Set the absolute path
+ r = pakfire_file_set_abspath(file, abspath);
+ if (r) {
+ ERROR(db->pakfire, "%s: Could not set absolute path %s: %m\n", path, abspath);
+ goto ERROR;
+ }
+
// Size
size_t size = sqlite3_column_int64(stmt, 1);
if (size)