From 758da3063176609fa5e00f24526244a24156f024 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 31 May 2024 18:32:30 +0200 Subject: [PATCH] backend-sqlite3.c: added arch field to packages table --- src/backend-sqlite3.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/backend-sqlite3.c b/src/backend-sqlite3.c index c7b977b..ed616c6 100644 --- a/src/backend-sqlite3.c +++ b/src/backend-sqlite3.c @@ -316,7 +316,7 @@ long generateSQLite_add_changelog(sqlite3 *db, struct changeLog* firstchangelog, } #define SQLITE_TABLE_packages "id INTEGER PRIMARY KEY, "\ - "name STRING, altrepository INTEGER, epoch INTEGER, version STRING, release STRING, summary STRING, "\ + "name STRING, arch STRING, altrepository INTEGER, epoch INTEGER, version STRING, release STRING, summary STRING, "\ "groupdescr STRING, description STRING, size INTEGER, id_source INTEGER" #define SQLITE_TABLE_obsoletes "id INTEGER PRIMARY KEY, "\ @@ -343,7 +343,7 @@ generateSQLite_packages(struct configTag *ct, sqlite3 *db, int arch) { currpackage = ct->headerlist[arch]; while (currpackage) { if (currpackage->altrepository == ct->repository_level) { - snprintf(sqlite3_query, PATH_MAX, "INSERT INTO packages VALUES(NULL,?,%d,%ld,?,?,?,?,?,%ld,%ld);", + snprintf(sqlite3_query, PATH_MAX, "INSERT INTO packages VALUES(NULL,?,?,%d,%ld,?,?,?,?,?,%ld,%ld);", currpackage->altrepository, currpackage->epoch, currpackage->size, @@ -354,11 +354,12 @@ generateSQLite_packages(struct configTag *ct, sqlite3 *db, int arch) { } sqlite3_bind_text(stmt, 1, currpackage->name, -1, SQLITE_STATIC); - sqlite3_bind_text(stmt, 2, currpackage->version, -1, SQLITE_STATIC); - sqlite3_bind_text(stmt, 3, currpackage->release, -1, SQLITE_STATIC); - sqlite3_bind_text(stmt, 4, currpackage->summary, -1, SQLITE_STATIC); - sqlite3_bind_text(stmt, 5, currpackage->group, -1, SQLITE_STATIC); - sqlite3_bind_text(stmt, 6, currpackage->description, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 2, currpackage->arch, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 3, currpackage->version, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 4, currpackage->release, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 5, currpackage->summary, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 6, currpackage->group, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 7, currpackage->description, -1, SQLITE_STATIC); if (sqlite3_step(stmt) != SQLITE_DONE) { fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));