#include "build/rpmbuild_internal.h"
#include "debug.h"
-static int isNewDep(rpmds *dsp, rpmTagVal nametag,
- const char *N, const char *EVR, rpmsenseFlags Flags,
+static int isNewDep(rpmds *dsp, rpmds bds,
Header h, rpmTagVal indextag, uint32_t index)
{
int isnew = 1;
- rpmds bds = rpmdsSingle(nametag, N, EVR, Flags);
if (!indextag) {
/* With normal deps, we can just merge and see if anything got added */
rpmdsMerge(dsp, bds);
}
- rpmdsFree(bds);
return isnew;
}
rpmTagVal indextag = 0;
rpmsenseFlags extra = RPMSENSE_ANY;
Header h = pkg->header; /* just a shortcut */
- rpmds *dsp = NULL;
+ rpmds newds, *dsp = NULL;
switch (tagN) {
case RPMTAG_PROVIDENAME:
if (EVR == NULL)
EVR = "";
+ newds = rpmdsSingle(tagN, N, EVR, Flags);
/* Avoid adding duplicate dependencies. */
- if (isNewDep(dsp, tagN, N, EVR, Flags, h, indextag, index)) {
+ if (isNewDep(dsp, newds, h, indextag, index)) {
headerPutString(h, tagN, N);
headerPutString(h, versiontag, EVR);
headerPutUint32(h, flagtag, &Flags, 1);
headerPutUint32(h, indextag, &index, 1);
}
}
+ rpmdsFree(newds);
return 0;
}