ref: refs/heads/master
commit e3c10bc6d2c8b577af96a2ad59a7c2b992477f19
Author: Michael Schroeder
Date: Wed Jul 15 18:37:29 2009 +0200
- allow index and match specification in getinstalledrpmdbids()
---
ext/repo_rpmdb.c | 6 ++++--
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);
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org