From 6ad258e0cad4741aad160dcb8a4b85f43fce60f1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 9 Dec 2008 16:03:55 +0000 Subject: - adapt to rpm 4.6 changes: - headerNextIterator -> headerNext - headerAddEntry -> headerPut - headerModifyEntry -> headerMod --- URPM.xs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/URPM.xs b/URPM.xs index 1dd4d6b..281c729 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1198,17 +1198,14 @@ parse_line(AV *depslist, HV *provides, HV *obsoletes, URPM__Package pkg, char *b static void pack_rpm_header(Header *h) { Header packed = headerNew(); - HeaderIterator hi; - int32_t type, c, tag; - void *p; - for (hi = headerInitIterator(*h); - headerNextIterator(hi, &tag, &type, (void *) &p, &c); - p = headerFreeData(p, type)) - { + HeaderIterator hi = headerInitIterator(*h); + struct rpmtd_s td; + while (headerNext(hi, &td)) { // fprintf(stderr, "adding %s %d\n", tagname(tag), c); - headerAddEntry(packed, tag, type, p, c); - } + headerPut(packed, &td, HEADERPUT_DEFAULT); + rpmtdFreeData(&td); + } headerFreeIterator(hi); headerFree(*h); @@ -3938,8 +3935,16 @@ Urpm_spec2srcheader(specfile) memset(pkg, 0, sizeof(struct s_Package)); headerPutString(spec->sourceHeader, RPMTAG_SOURCERPM, ""); - /* parseSpec() sets RPMTAG_ARCH to %{_target_cpu} whereas we really a header similar to .src.rpm header */ - headerModifyEntry(spec->sourceHeader, RPMTAG_ARCH, RPM_STRING_TYPE, "src", 1); + { + struct rpmtd_s td = { + .tag = RPMTAG_ARCH, + .type = RPM_STRING_TYPE, + .data = (void *) "src", + .count = 1, + }; + /* parseSpec() sets RPMTAG_ARCH to %{_target_cpu} whereas we really a header similar to .src.rpm header */ + headerMod(spec->sourceHeader, &td); + } pkg->h = headerLink(spec->sourceHeader); sv_pkg = sv_newmortal(); -- cgit v1.2.1