From: Michael Tremer Date: Wed, 10 Feb 2021 11:47:51 +0000 (+0000) Subject: db: Import more text fields into the package database X-Git-Tag: 0.9.28~1285^2~773 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f8260348eacf8de0d3b5a48c13b84b6e1ef4183;p=pakfire.git db: Import more text fields into the package database Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/db.c b/src/libpakfire/db.c index c53412a48..be782819b 100644 --- a/src/libpakfire/db.c +++ b/src/libpakfire/db.c @@ -1404,6 +1404,78 @@ static int pakfire_db_load_package(struct pakfire_db* db, PakfireRepo repo, sqli goto ERROR; } + // Groups + const char* groups = (const char*)sqlite3_column_text(stmt, 5); + if (groups) { + pakfire_package_set_groups(pkg, groups); + } + + // Filename + const char* filename = (const char*)sqlite3_column_text(stmt, 6); + if (filename) { + pakfire_package_set_filename(pkg, filename); + } + + // Size + size_t size = sqlite3_column_int64(stmt, 7); + if (size) { + pakfire_package_set_downloadsize(pkg, size); + } + + // Installed size + size = sqlite3_column_int64(stmt, 8); + if (size) { + pakfire_package_set_installsize(pkg, size); + } + + // Hash 1 + const char* hash1 = (const char*)sqlite3_column_text(stmt, 9); + if (hash1) { + pakfire_package_set_checksum(pkg, hash1); + } + + // License + const char* license = (const char*)sqlite3_column_text(stmt, 10); + if (license) { + pakfire_package_set_license(pkg, license); + } + + // Summary + const char* summary = (const char*)sqlite3_column_text(stmt, 11); + if (summary) { + pakfire_package_set_summary(pkg, summary); + } + + // Description + const char* description = (const char*)sqlite3_column_text(stmt, 12); + if (description) { + pakfire_package_set_description(pkg, description); + } + + // UUID + const char* uuid = (const char*)sqlite3_column_text(stmt, 13); + if (uuid) { + pakfire_package_set_uuid(pkg, uuid); + } + + // Vendor + const char* vendor = (const char*)sqlite3_column_text(stmt, 14); + if (vendor) { + pakfire_package_set_vendor(pkg, vendor); + } + + // Build Host + const char* build_host = (const char*)sqlite3_column_text(stmt, 15); + if (build_host) { + pakfire_package_set_buildhost(pkg, build_host); + } + + // Build Time + time_t build_time = sqlite3_column_int64(stmt, 16); + if (build_time) { + pakfire_package_set_buildtime(pkg, build_time); + } + // Success r = 0; @@ -1425,11 +1497,8 @@ int pakfire_db_load(struct pakfire_db* db, PakfireRepo repo) { const char* sql = "SELECT " - "name, " - "epoch, " - "version, " - "release, " - "arch " + "name, epoch, version, release, arch, groups, filename, size, inst_size, " + "hash1, license, summary, description, uuid, vendor, build_host, build_time " "FROM " "packages" ";";