- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides

"Pawel A. Gajda" <mis@k2.net.pl>.

CVS patchset: 4236
CVS date: 2000/10/31 16:53:14
This commit is contained in:
jbj 2000-10-31 16:53:14 +00:00
parent edfbc6958a
commit 865ba80f1e
3 changed files with 43 additions and 0 deletions

View File

@ -23,6 +23,8 @@
- add brp-strip-shared script <rodrigob@conectiva.com.br>.
- better item/task progress bars <rodrigob@conectiva.com.br>.
- add support for SHA1 as well as MD5 message digests.
- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
"Pawel A. Gajda" <mis@k2.net.pl>.
3.0.6 -> 4.0
- use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db.

View File

@ -904,6 +904,16 @@ typedef enum rpmtransFlags_e {
RPMTRANS_FLAG_MULTILIB = (1 << 8), /*!< @todo Document. */
} rpmtransFlags;
/** \ingroup rpmtrans
* Return copy of rpmlib internal provides.
* @retval address of array of rpmlib internal provide names
* @retval address of array of rpmlib internal provide flags
* @retval address of array of rpmlib internal provide versions
* @return no. of entries
*/
int rpmGetRpmlibProvides(/*@out@*/ const char ***provNames,
/*@out@*/ int **provFlags, /*@out@*/ const char ***provVersions) /*@*/;
/** \ingroup rpmtrans
* Compare two versioned dependency ranges, looking for overlap.
* @param AName 1st dependncy name string

View File

@ -52,3 +52,34 @@ int rpmCheckRpmlibProvides(const char * keyName, const char * keyEVR,
}
return rc;
}
int rpmGetRpmlibProvides(const char ***provNames, int **provFlags,
const char ***provVersions)
{
char **names, **versions;
int *flags;
int n = 0;
while (rpmlibProvides[n++].featureName != NULL)
;
names = xmalloc(sizeof(*names) * n);
versions = xmalloc(sizeof(*versions) * n);
flags = xmalloc(sizeof(*flags) * n);
n = 0;
while (rpmlibProvides[n].featureName != NULL) {
names[n] = rpmlibProvides[n].featureName;
flags[n] = rpmlibProvides[n].featureFlags;
versions[n] = rpmlibProvides[n].featureEVR;
n++;
}
names[n] = NULL;
versions[n] = NULL;
*provNames = names;
*provFlags = flags;
*provVersions = versions;
return n;
}