Add rpmdsDToTagN() to convert single char endocding used by the dependency generators to tags

This commit is contained in:
Florian Festi 2014-06-06 12:23:22 +02:00
parent 2e9864752d
commit 1ba4a76a54
2 changed files with 42 additions and 0 deletions

View File

@ -139,6 +139,41 @@ static char tagNToChar(rpmTagVal tagN)
}
}
rpmTagVal rpmdsDToTagN(char deptype)
{
rpmTagVal tagN = RPMTAG_REQUIRENAME;
switch (deptype) {
default:
tagN = RPMTAG_NOT_FOUND;
break;
case 'P':
tagN = RPMTAG_PROVIDENAME;
break;
case 'R':
tagN = RPMTAG_REQUIRENAME;
break;
case 'r':
tagN = RPMTAG_RECOMMENDNAME;
break;
case 's':
tagN = RPMTAG_SUGGESTNAME;
break;
case 'S':
tagN = RPMTAG_SUPPLEMENTNAME;
break;
case 'e':
tagN = RPMTAG_ENHANCENAME;
break;
case 'C':
tagN = RPMTAG_CONFLICTNAME;
break;
case 'O':
tagN = RPMTAG_OBSOLETENAME;
break;
}
return tagN;
}
rpmsid rpmdsNIdIndex(rpmds ds, int i)
{
rpmsid id = 0;

View File

@ -196,6 +196,13 @@ const char * rpmdsDNEVR(const rpmds ds);
*/
char rpmdsD(const rpmds ds);
/** \ingroup rpmds
* Return matching tagN for one char dependency type description.
* @param deptype character
* @return type of dependency
*/
rpmTagVal rpmdsDToTagN(char deptype);
/** \ingroup rpmds
* Return current dependency name.
* @param ds dependency set