RPM::Transaction(3)

NAME
RPM::Transaction

DESCRIPTION

FUNCTIONS

  new
Create a new RPM::Transaction.

  $ts->setrootdir
Set the root path for the transaction. Should be called before any action.

  $ts->vsflags
Return the current vsflags set in the transaction.

An optionnal vsflags can be passed, in this case the new vsflags is set, old value is returned:

    $ts->vsflag(4);
    my $oldflags = $ts->vsflag(6);
    # $oldflags contains 6
    my $flags = $ts->vsflag();
    # $flags contains 6

  $ts->transflags
Return the current transflags set in the transaction.

An optionnal transflags can be passed, in this case the new transflags is set, old value is returned:

    $ts->transflag(4);
    my $oldflags = $ts->transflag(6);
    # $oldflags contains 6
    my $flags = $ts->transflag();
    # $flags contains 6

  $ts->packageiterator
Return a RPM::PackageIterator against rpmdb use in the transaction.

See RPM::PackageIterator

  $ts->add_install($header, $key, $upgrade)
Add a new package to install into the transaction.

$header is the RPM::Header from the rpm to add
$key an arbitrary value that can be set to identify the element
$upgrade: (optional, default to 1) the package will upgrade already installed packages.

  $ts->add_delete($header, $offset)
Add a package to remove from transaction

$header is the RPM::Header of the rpm to uninstall
$offset is the db location of the rpm to uninstall

  $ts->element_count()
Return the count of element in transaction.

  $ts->check()
Check the transaction as no problem, return True on success.

  $ts->problems()
Return a RPM::Problems object if any.

  $ts->order()
Order the transaction, return True on success.

Return as second value the count of unordered element:

    my $result = $ts->order();

or

    my ($result, $unordered) = $ts->order();

  $ts->run()
Run the transaction, aka install/uninstall pkg.

  $ts->dbadd($header)
Inject a RPM::Header into the rpmdb.

  $ts->dbremove($offset)
Remove the header at $offset from the rpmdb.

  $ts->opendb($write)
Open the rpmdatabase attached to the transaction, if $write is true, in write mode

Normally this is not need, rpmdb is automatically open when need.

Be careful: If an rpmdb is open'ed manually, that disables lazy opens, so you'll to close it manually.

  $ts->closedb
Close the rpmdb attached to transaction.

Normally this is not need, rpmdb is automatically closed after each operation.

  $ts->initdb($write)
Create and open the rpmdb attaced to transaction, see opendb.

  $ts->verifydb
Verify the rpmdb.

  $ts->rebuilddb
Rebuild the rpmdb.

  $ts->readheader
Read a rpm and return a RPM::Header object

  $ts->importpubkey
Import public key.

  $ts->checkrpm
Check rpm..? (FIXME)