diff options
author | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-12 17:37:34 +0000 |
---|---|---|
committer | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-12 17:37:34 +0000 |
commit | e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156 (patch) | |
tree | ce12de70687c82ce9fca09150f8f22af724f1e70 | |
parent | f330f38ae9b549028b5e649858a1673a5753855d (diff) | |
download | perl-RPM4-e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156.tar perl-RPM4-e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156.tar.gz perl-RPM4-e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156.tar.bz2 perl-RPM4-e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156.tar.xz perl-RPM4-e5ad3f774c0d1fa87e460cdeee2bd0d1c5ce1156.zip |
(addtag) adapt to rpm 4.6 changes:
- headerAddOrAppendEntry -> headerPut
- headerAddEntry -> headerPutString
also thread RPM_STRING_TYPE like RPM_BIN_TYPE else this introduces a
testsuite regression
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@194 971eb68f-4bfb-0310-8326-d2484c010a4c
-rw-r--r-- | RPM4/src/RPM4.xs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 1535890..4e62492 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -1047,25 +1047,33 @@ Header_addtag(h, sv_tag, sv_tagtype, ...) /* if (tag == RPMTAG_OLDFILENAMES) expandFilelist(h); */ for (i = 3; (i < items) && RETVAL; i++) { + struct rpmtd_s td = { + .tag = tag, + .type = tagtype, + .data = (void *) &value, + .count = 1, + }; switch (tagtype) { case RPM_CHAR_TYPE: case RPM_INT8_TYPE: case RPM_INT16_TYPE: case RPM_INT32_TYPE: ivalue = SvUV(ST(i)); - RETVAL = headerAddOrAppendEntry(h, tag, tagtype, &ivalue, 1); + td.data = (void *) &ivalue; + RETVAL = headerPut(h, &td, HEADERPUT_APPEND); break; + case RPM_STRING_TYPE: case RPM_BIN_TYPE: value = (char *)SvPV(ST(i), len); - RETVAL = headerAddEntry(h, tag, tagtype, value, len); + RETVAL = headerPutString(h, tag, value); break; case RPM_STRING_ARRAY_TYPE: value = SvPV_nolen(ST(i)); - RETVAL = headerAddOrAppendEntry(h, tag, tagtype, &value, 1); + RETVAL = headerPut(h, &td, HEADERPUT_APPEND); break; default: value = SvPV_nolen(ST(i)); - RETVAL = headerAddOrAppendEntry(h, tag, tagtype, value, 1); + RETVAL = headerPut(h, &td, HEADERPUT_APPEND); break; } } |