]> git.ipfire.org Git - pakfire.git/commitdiff
db: Import more text fields into the package database
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Feb 2021 11:47:51 +0000 (11:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Feb 2021 11:47:51 +0000 (11:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/db.c

index c53412a4834d3a3bf54047b281a0144dc030494c..be782819b8c444ad99fa612ca1280f4d978efed4 100644 (file)
@@ -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"
                ";";