int addReqProv(rpmSpec spec, Header h, rpmTag tagN,
const char * N, const char * EVR, rpmsenseFlags Flags,
- int index)
+ uint32_t index)
{
rpmTag nametag = 0;
rpmTag versiontag = 0;
rpmTag flagtag = 0;
rpmTag indextag = 0;
rpmsenseFlags extra = RPMSENSE_ANY;
- int xx;
+ struct rpmtd_s td;
if (Flags & RPMSENSE_PROVIDES) {
nametag = RPMTAG_PROVIDENAME;
}
/* Add this dependency. */
- xx = headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &N, 1);
+ if (rpmtdFromStringArray(&td, nametag, &N, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_STRING_ARRAY_TYPE);
if (flagtag) {
- xx = headerAddOrAppendEntry(h, versiontag,
- RPM_STRING_ARRAY_TYPE, &EVR, 1);
- xx = headerAddOrAppendEntry(h, flagtag,
- RPM_INT32_TYPE, &Flags, 1);
+ if (rpmtdFromStringArray(&td, versiontag, &EVR, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_STRING_ARRAY_TYPE);
+ if (rpmtdFromUint32(&td, flagtag, &Flags, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_INT32_TYPE);
+ }
+ if (indextag) {
+ if (rpmtdFromUint32(&td, indextag, &index, 1))
+ headerPut(h, &td, HEADERPUT_APPEND);
+ assert(rpmtdType(&td) == RPM_INT32_TYPE);
}
- if (indextag)
- xx = headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1);
exit:
rpmdsFree(hds);