From 3d08e89c98cf2ebddb42fd43b13d30a8515f975e Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Tue, 26 Jun 2012 17:23:46 +0200 Subject: [PATCH] - repo_rpmdb: read in RPMTAG_SHA1HEADER --- ext/repo_rpmdb.c | 8 ++++++++ ext/repo_rpmdb.h | 1 + 2 files changed, 9 insertions(+) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 23b5508..3c01239 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -51,6 +51,8 @@ /* 4: fixed triggers */ #define RPMDB_COOKIE_VERSION 4 +#define TAG_SIGBASE 256 +#define TAG_SHA1HEADER TAG_SIGBASE+13 #define TAG_NAME 1000 #define TAG_VERSION 1001 #define TAG_RELEASE 1002 @@ -983,6 +985,12 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead, str = headstring(rpmhead, TAG_PACKAGER); if (str) repodata_set_poolstr(data, handle, SOLVABLE_PACKAGER, str); + if ((flags & RPM_ADD_WITH_HDRID) != 0) + { + str = headstring(rpmhead, TAG_SHA1HEADER); + if (str) + repodata_set_poolstr(data, handle, SOLVABLE_HDRID, str); + } u32 = headint32(rpmhead, TAG_BUILDTIME); if (u32) repodata_set_num(data, handle, SOLVABLE_BUILDTIME, u32); diff --git a/ext/repo_rpmdb.h b/ext/repo_rpmdb.h index f8251cb..243bc40 100644 --- a/ext/repo_rpmdb.h +++ b/ext/repo_rpmdb.h @@ -22,6 +22,7 @@ extern Id repo_add_pubkey(Repo *repo, const char *key, int flags); #define RPM_ADD_WITH_SHA1SUM (1 << 12) #define RPM_ADD_WITH_SHA256SUM (1 << 13) #define RPM_ADD_TRIGGERS (1 << 14) +#define RPM_ADD_WITH_HDRID (1 << 15) #define RPM_ITERATE_FILELIST_ONLYDIRS (1 << 0) #define RPM_ITERATE_FILELIST_WITHMD5 (1 << 1) -- 2.7.4