- repo_rpmdb: read in RPMTAG_SHA1HEADER
authorAles Kozumplik <ales@redhat.com>
Tue, 26 Jun 2012 15:23:46 +0000 (17:23 +0200)
committerAles Kozumplik <ales@redhat.com>
Wed, 27 Jun 2012 08:11:38 +0000 (10:11 +0200)
ext/repo_rpmdb.c
ext/repo_rpmdb.h

index 23b5508dfb45e52e0cd00a3e490b0804512ebeb9..3c012396c28e9ea0489255bbda2366d5859a5c76 100644 (file)
@@ -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);
index f8251cbc72996594e096d576f1a93d90a420289b..243bc40f88e047852665b153f7aa00b8a1839992 100644 (file)
@@ -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)