tries to solve open package dependencies
and marks other (dependant) packages for installation/deletion.
(It currently does an automatic solving without user interaction. Callbacks
for user interaction will be added later.)
Committing the changes
list Pkg::PkgCommit (integer) does the 'rpm' calls
needed to install or delete packages.
It sorts the packages according to their pre-requires and their
location on the media (CD order), handles mouting/unmounting of
the media, does the package download (if the media is an ftp or
http server), and calls rpm.
All these actions might trigger callbacks for user information
or user actions (i.e. media change).
The module PackageCallbacks from yast2-packager.rpm
defined default callbacks for all these actions and should be
imported by any code using Pkg::PkgCommit(0).
The integer parameter given to Pkg::PkgCommit(0) must
be zero for the normal usage. Non-zero values are only allowed
during system installation when no media change is possible.
Example code
{
import "PackageCallbacks";
// installing netscape and cups
Pkg::PkgInstall ("netscape");
Pkg::PkgInstall ("cups");
// deleting lprng if it is installed
if (Pkg::IsProvided ("lprng"))
Pkg::PkgDelete ("lprng");
// fill open dependencies
Pkg::PkgSolve();
// do the rpm calls
Pkg::PkgCommit();
}