diff options
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); } |