Add dbinstance tag extension (port from rpm5.org)

This commit is contained in:
Panu Matilainen 2009-09-01 15:08:58 +03:00
parent 7c15b12f02
commit 0fd95da2e7
3 changed files with 15 additions and 0 deletions

View File

@ -270,6 +270,7 @@ typedef enum rpmTag_e {
RPMTAG_REQUIREATTRSX = 1192, /* i[] (unimplemented) */
RPMTAG_BUILDPROVIDES = 1193, /* internal */
RPMTAG_BUILDOBSOLETES = 1194, /* internal */
RPMTAG_DBINSTANCE = 1195, /* i extension */
RPMTAG_FILENAMES = 5000, /* s[] extension */
RPMTAG_FILEPROVIDE = 5001, /* s[] extension */
RPMTAG_FILEREQUIRE = 5002, /* s[] extension */

View File

@ -631,6 +631,18 @@ static int longsigsizeTag(Header h, rpmtd td, headerGetFlags hgflags)
return get64(h, td, RPMTAG_LONGSIGSIZE, RPMTAG_SIGSIZE);
}
static int dbinstanceTag(Header h, rpmtd td, headerGetFlags hgflags)
{
uint32_t *recno = xmalloc(sizeof(*recno));
recno[0] = headerGetInstance(h);
td->type = RPM_INT32_TYPE;
td->count = 1;
td->data = recno;
td->flags = RPMTD_ALLOCED;
return 1; /* this cannot fail */
}
void *rpmHeaderTagFunc(rpmTag tag)
{
const struct headerTagFunc_s * ext;
@ -663,6 +675,7 @@ static const struct headerTagFunc_s rpmHeaderTagExtensions[] = {
{ RPMTAG_LONGARCHIVESIZE, longarchivesizeTag },
{ RPMTAG_LONGSIZE, longsizeTag },
{ RPMTAG_LONGSIGSIZE, longsigsizeTag },
{ RPMTAG_DBINSTANCE, dbinstanceTag },
{ 0, NULL }
};

View File

@ -86,6 +86,7 @@ CONFLICTNAME
CONFLICTS
CONFLICTVERSION
COOKIE
DBINSTANCE
DEPENDSDICT
DESCRIPTION
DIRINDEXES