diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-12-09 16:03:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-12-09 16:03:55 +0000 |
commit | 6ad258e0cad4741aad160dcb8a4b85f43fce60f1 (patch) | |
tree | 187a72c14ec6078cbf23f9815ed61da965cf651b | |
parent | 784a6c76dca9da692f7b190bf0879fcb3e2fabcb (diff) | |
download | perl-URPM-6ad258e0cad4741aad160dcb8a4b85f43fce60f1.tar perl-URPM-6ad258e0cad4741aad160dcb8a4b85f43fce60f1.tar.gz perl-URPM-6ad258e0cad4741aad160dcb8a4b85f43fce60f1.tar.bz2 perl-URPM-6ad258e0cad4741aad160dcb8a4b85f43fce60f1.tar.xz perl-URPM-6ad258e0cad4741aad160dcb8a4b85f43fce60f1.zip |
- adapt to rpm 4.6 changes:
- headerNextIterator -> headerNext
- headerAddEntry -> headerPut
- headerModifyEntry -> headerMod
-rw-r--r-- | URPM.xs | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -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(); |