summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2000-04-27 00:10:28 +0000
committerjbj <devnull@localhost>2000-04-27 00:10:28 +0000
commit24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8 (patch)
tree521f462f0c4557f5a12af2d5af9a5b54163092ea /python
parentb24f837828e451a5ddf371038a2f2f0ed64580a2 (diff)
downloadlibrpm-tizen-24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8.tar.gz
librpm-tizen-24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8.tar.bz2
librpm-tizen-24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8.zip
- API: replace rpmdbUpdateRecord with rpmdbRemove/rpmdbAdd.
- API: replace rpmdbFindByLabel with RPMDBI_LABEL iteration. - API: replace rpmdbGetRecord with iterators. - API: replace findMatches with iterators. CVS patchset: 3704 CVS date: 2000/04/27 00:10:28
Diffstat (limited to 'python')
-rw-r--r--python/rpmmodule.c11
-rw-r--r--python/upgrade.c3
2 files changed, 11 insertions, 3 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 302dbe78e..1511ae9eb 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -966,7 +966,7 @@ rpmdbLength(rpmdbObject * s) {
{ rpmdbMatchIterator mi;
/* RPMDBI_PACKAGES */
- mi = rpmdbInitIterator(s->db, 0, NULL, 0);
+ mi = rpmdbInitIterator(s->db, RPMDBI_PACKAGES, NULL, 0);
/* XXX FIXME: unnecessary header mallocs are side effect here */
while (rpmdbNextIterator(mi) != NULL)
count++;
@@ -991,7 +991,16 @@ rpmdbSubscript(rpmdbObject * s, PyObject * key) {
h = PyObject_NEW(hdrObject, &hdrType);
h->h = NULL;
+#ifdef DYING
h->h = rpmdbGetRecord(s->db, offset);
+#else
+ { rpmdbMatchIterator mi;
+ mi = rpmdbInitIterator(s->db, RPMDBI_PACKAGES, &offset, sizeof(offset));
+ if ((h->h = rpmdbNextIterator(mi)) != NULL)
+ h->h = headerLink(h->h);
+ rpmdbFreeIterator(mi);
+ }
+#endif
h->fileList = h->linkList = h->md5list = NULL;
h->uids = h->gids = h->mtimes = h->fileSizes = NULL;
h->modes = h->rdevs = NULL;
diff --git a/python/upgrade.c b/python/upgrade.c
index 4c20425e4..1ce68e4f7 100644
--- a/python/upgrade.c
+++ b/python/upgrade.c
@@ -122,8 +122,7 @@ static void addLostFiles(rpmdb db, struct pkgSet *psp, struct hash_table *ht)
#else
rpmdbMatchIterator mi;
- /* RPMDBI_PACKAGES */
- mi = rpmdbInitIterator(db, 0, NULL, 0);
+ mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0);
while ((h = rpmdbNextIterator(mi)) != NULL) {
#endif