diff options
author | Michael Schroeder <mls@suse.de> | 2009-07-15 18:37:29 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2009-07-15 18:37:29 +0200 |
commit | 336a60ce0be198f8a0aa910a8ec0c27737f2a346 (patch) | |
tree | 3557964dc72803c780f003954461798152921a58 /ext | |
parent | 514dcb91b785784f44e6ed2ba886cb3e26d33f50 (diff) | |
download | libsolv-336a60ce0be198f8a0aa910a8ec0c27737f2a346.tar.gz libsolv-336a60ce0be198f8a0aa910a8ec0c27737f2a346.tar.bz2 libsolv-336a60ce0be198f8a0aa910a8ec0c27737f2a346.zip |
- allow index and match specification in getinstalledrpmdbids()
Diffstat (limited to 'ext')
-rw-r--r-- | ext/repo_rpmdb.c | 6 | ||||
-rw-r--r-- | ext/repo_rpmdb.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index d9c7849..911f1af 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -2185,19 +2185,21 @@ getinstalledrpmdbids(struct rpm_by_state *state, const char *index, const char * } int -rpm_installedrpmdbids(const char *rootdir, Queue *rpmdbidq) +rpm_installedrpmdbids(const char *rootdir, const char *index, const char *match, Queue *rpmdbidq) { struct rpm_by_state state; struct rpmdbentry *entries; int nentries, i; char *namedata; + if (!index) + index = "Name"; if (rpmdbidq) queue_empty(rpmdbidq); memset(&state, 0, sizeof(state)); if (!(state.dbenv = opendbenv(rootdir))) return 0; - entries = getinstalledrpmdbids(&state, "Name", 0, &nentries, &namedata, 0); + entries = getinstalledrpmdbids(&state, index, match, &nentries, &namedata, 0); if (rpmdbidq) for (i = 0; i < nentries; i++) queue_push(rpmdbidq, entries[i].rpmdbid); diff --git a/ext/repo_rpmdb.h b/ext/repo_rpmdb.h index e5856e4..78dd2f3 100644 --- a/ext/repo_rpmdb.h +++ b/ext/repo_rpmdb.h @@ -32,4 +32,4 @@ void *rpm_byrpmh(struct headerToken_s *h, void **statep); char *rpm_query(void *rpmhandle, Id what); void rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char *, int, const char *), void *cbdata); -int rpm_installedrpmdbids(const char *rootdir, Queue *rpmdbidq); +int rpm_installedrpmdbids(const char *rootdir, const char *index, const char *match, Queue *rpmdbidq); |