diff options
author | jbj <devnull@localhost> | 2000-04-27 00:10:28 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-04-27 00:10:28 +0000 |
commit | 24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8 (patch) | |
tree | 521f462f0c4557f5a12af2d5af9a5b54163092ea /python/rpmmodule.c | |
parent | b24f837828e451a5ddf371038a2f2f0ed64580a2 (diff) | |
download | rpm-24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8.tar.gz rpm-24a64f27394fcf24e3e3f3d9d2f7b321f603a6a8.tar.bz2 rpm-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/rpmmodule.c')
-rw-r--r-- | python/rpmmodule.c | 11 |
1 files changed, 10 insertions, 1 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; |