aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-09 16:03:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-09 16:03:55 +0000
commit6ad258e0cad4741aad160dcb8a4b85f43fce60f1 (patch)
tree187a72c14ec6078cbf23f9815ed61da965cf651b /URPM.xs
parent784a6c76dca9da692f7b190bf0879fcb3e2fabcb (diff)
downloadperl-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
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs27
1 files 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();