summaryrefslogtreecommitdiff
path: root/build/parseChangelog.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-06-17 12:55:01 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-06-17 12:55:01 +0300
commita61a1785a66a908af1c4d91b428af9c7ddfced08 (patch)
tree4c99cc9d600668c2cfd3ef3465c740864093e814 /build/parseChangelog.c
parent2b6f72a7ee51e6a38b845ade303897e4f9194a2b (diff)
downloadlibrpm-tizen-a61a1785a66a908af1c4d91b428af9c7ddfced08.tar.gz
librpm-tizen-a61a1785a66a908af1c4d91b428af9c7ddfced08.tar.bz2
librpm-tizen-a61a1785a66a908af1c4d91b428af9c7ddfced08.zip
Convert parseChangelog to headerPut()
Diffstat (limited to 'build/parseChangelog.c')
-rw-r--r--build/parseChangelog.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index b0dc13592..0b9203033 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -16,13 +16,19 @@
void addChangelogEntry(Header h, time_t time, const char *name, const char *text)
{
rpm_time_t mytime = time; /* XXX convert to header representation */
- HAE_t hae = headerAddEntry;
- if (headerIsEntry(h, RPMTAG_CHANGELOGTIME)) {
- hae = headerAppendEntry;
- }
- (void) hae(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, &mytime, 1);
- (void) hae(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, &name, 1);
- (void) hae(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, &text, 1);
+ struct rpmtd_s td;
+
+ if (rpmtdFromUint32(&td, RPMTAG_CHANGELOGTIME, &mytime, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_INT32_TYPE);
+
+ if (rpmtdFromStringArray(&td, RPMTAG_CHANGELOGNAME, &name, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_STRING_ARRAY_TYPE);
+
+ if (rpmtdFromStringArray(&td, RPMTAG_CHANGELOGTEXT, &text, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_STRING_ARRAY_TYPE);
}
/**