Add rpmdsPutToHeader function to to API
This commit is contained in:
parent
ace39f7bf5
commit
44acd3f63f
18
lib/rpmds.c
18
lib/rpmds.c
|
@ -381,6 +381,24 @@ rpmds rpmdsCurrent(rpmds ds)
|
|||
return cds;
|
||||
}
|
||||
|
||||
int rpmdsPutToHeader(rpmds ds, Header h)
|
||||
{
|
||||
rpmTagVal tagN = rpmdsTagN(ds);
|
||||
rpmTagVal tagEVR = rpmdsTagEVR(ds);
|
||||
rpmTagVal tagF = rpmdsTagF(ds);
|
||||
if (!tagN)
|
||||
return -1;
|
||||
|
||||
rpmds pi = rpmdsInit(ds);
|
||||
while (rpmdsNext(pi) >= 0) {
|
||||
rpmsenseFlags flags = rpmdsFlags(pi);
|
||||
headerPutString(h, tagN, rpmdsN(pi));
|
||||
headerPutString(h, tagEVR, rpmdsEVR(pi));
|
||||
headerPutUint32(h, tagF, &flags, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rpmdsCount(const rpmds ds)
|
||||
{
|
||||
return (ds != NULL ? ds->Count : 0);
|
||||
|
|
|
@ -142,6 +142,14 @@ rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlag
|
|||
*/
|
||||
rpmds rpmdsCurrent(rpmds ds);
|
||||
|
||||
/** \ingroup rpmds
|
||||
* Write content of the dependency set to the header
|
||||
* @param ds dependency set
|
||||
* @param h header
|
||||
* @return 0 on success
|
||||
*/
|
||||
int rpmdsPutToHeader(rpmds ds, Header h);
|
||||
|
||||
/** \ingroup rpmds
|
||||
* Return dependency set count.
|
||||
* @param ds dependency set
|
||||
|
|
Loading…
Reference in New Issue