diff options
author | Frederic Lepied <flepied@mandriva.com> | 2000-10-19 12:26:49 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2000-10-19 12:26:49 +0000 |
commit | ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d (patch) | |
tree | 0bf54e676118f1acaf3727a15033c9afb81e489f /rpm-find-leaves.c | |
parent | 22043e605df0b810c7c688ee96c2a3caffe85f56 (diff) | |
download | rpmtools-ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d.tar rpmtools-ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d.tar.gz rpmtools-ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d.tar.bz2 rpmtools-ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d.tar.xz rpmtools-ac2e4abe983f7de769ecef5e35f9c33f0bc88d7d.zip |
use iterators.
Diffstat (limited to 'rpm-find-leaves.c')
-rw-r--r-- | rpm-find-leaves.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rpm-find-leaves.c b/rpm-find-leaves.c index c72337a..45e2e29 100644 --- a/rpm-find-leaves.c +++ b/rpm-find-leaves.c @@ -28,17 +28,18 @@ int main() { int numConflicts; rpmdb db; int i; + rpmdbMatchIterator mi; rpmReadConfigFiles(NULL, NULL); db = open_rpmdb(); - for(i = rpmdbFirstRecNum(db); i; i = rpmdbNextRecNum(db, i)) { + while(header = rpmdbNextIterator(mi)) { trans = rpmtransCreateSet(db, NULL); + i=rpmdbGetIteratorOffset(mi); rpmtransRemovePackage(trans, i); if (rpmdepCheck(trans, &conflicts, &numConflicts)) die("rpmdepCheck"); if (numConflicts == 0) { - header = rpmdbGetRecord(db, i); printf("%s-%s-%s\n", get(RPMTAG_NAME), get(RPMTAG_VERSION), get(RPMTAG_RELEASE)); headerFree(header); } |