From af58277e8c2c2202ed84ee3a0c8291d6b20d0464 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jul 2024 21:41:33 +0200 Subject: [PATCH] distromatic: add buildtime field to binary packages dbs --- src/backend-sqlite3.c | 5 +++-- src/headerlist.c | 1 + src/include/headerlist.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend-sqlite3.c b/src/backend-sqlite3.c index 1906639..2f8b558 100644 --- a/src/backend-sqlite3.c +++ b/src/backend-sqlite3.c @@ -317,7 +317,7 @@ long generateSQLite_add_changelog(sqlite3 *db, struct changeLog* firstchangelog, #define SQLITE_TABLE_packages "id INTEGER PRIMARY KEY, "\ "name STRING, arch STRING, altrepository INTEGER, epoch INTEGER, version STRING, release STRING, summary STRING, "\ - "groupdescr STRING, description STRING, size INTEGER, id_source INTEGER" + "groupdescr STRING, description STRING, buildtime INTEGER, size INTEGER, id_source INTEGER" #define SQLITE_TABLE_obsoletes "id INTEGER PRIMARY KEY, "\ "id_package INTEGER, obsoletename STRING, obsoleteflags INTEGER, obsoleteversion STRING" @@ -343,9 +343,10 @@ 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,%ld);", currpackage->altrepository, currpackage->epoch, + currpackage->buildtime, currpackage->size, currpackage->sourceheader->id); if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) { diff --git a/src/headerlist.c b/src/headerlist.c index 42e3bc0..4d4c32c 100644 --- a/src/headerlist.c +++ b/src/headerlist.c @@ -171,6 +171,7 @@ getPackageInfoIntoHeaderList(Header h, struct headerList *hl) hl->description = headerGetStringEntry(h, RPMTAG_DESCRIPTION); hl->sourcename = headerGetStringEntry(h, RPMTAG_SOURCERPM); hl->group = headerGetStringEntry(h, RPMTAG_GROUP); + hl->buildtime = headerGetUIntEntry(h, RPMTAG_BUILDTIME); hl->size = headerGetUIntEntry(h, RPMTAG_SIZE); return 0; diff --git a/src/include/headerlist.h b/src/include/headerlist.h index e73af3b..8ad4cab 100644 --- a/src/include/headerlist.h +++ b/src/include/headerlist.h @@ -79,6 +79,7 @@ struct headerList { char *description; char *sourcename; char *arch; + long buildtime; long size; char **obsoletename; uint_32 *obsoleteflags;