RPM::PackageIterator(3)

NAME
RPM::PackageIterator

DESCRIPTION
An iterator over rpm in current transaction.

FUNCTIONS

  new()
Create a new iterator over an empty transaction.

This is useful to query rpm currently existing in rpmdb. To get an iterator over a pending transaction see packageiterator function from RPM::Transaction.

To filter result and using rpmdb index, the function can be called with the tag to filter and the wanted value:

    RPM::PackageIterator->new("PROVIDESNAME", "rpm");

Will return all installed rpm having "rpm" as PROVIDES tag

  $iter->next()
Return next RPM::Header object found by iterator, nothing if last entry has been reached.

  $iter->count()
Return the count of entry found by iterator.

  $iter->getoffset
Return the offset of last header return by last next call.

  $iter->prune(@offset)
Filter also rpm located in rpmdb at offset list in @offset.

This is useful from a RPM::Transaction to filter pending removed rpms when solving dependencies.