#include <RpmDb.h>
Public Types | |
| enum | RpmInstFlag { RPMINST_NONE = 0x0000, RPMINST_NODOCS = 0x0001, RPMINST_NOSCRIPTS = 0x0002, RPMINST_FORCE = 0x0004, RPMINST_NODEPS = 0x0008, RPMINST_IGNORESIZE = 0x0010, RPMINST_JUSTDB = 0x0020, RPMINST_NODIGEST = 0x0040, RPMINST_NOSIGNATURE = 0x0080, RPMINST_NOUPGRADE = 0x0100, RPMINST_TEST = 0x0200 } |
| Bits representing rpm installation options, useable as or combination. More... | |
| enum | checkPackageResult { CHK_OK = 0, CHK_NOTFOUND = 1, CHK_FAIL = 2, CHK_NOTTRUSTED = 3, CHK_NOKEY = 4, CHK_ERROR = 5 } |
| checkPackage result More... | |
| typedef class InstTargetError | Error |
| Default error class. | |
| typedef std::set < std::string > | FileList |
Public Member Functions | |
| RpmDb () | |
| Constructor. | |
| ~RpmDb () | |
| Destructor. | |
| Date | timestamp () const |
| timestamp of the rpm database (last modification) | |
| const Pathname & | root () const |
| |
| const Pathname & | dbPath () const |
| |
| bool | initialized () const |
| |
| void | initDatabase (Pathname root_r=Pathname(), Pathname dbPath_r=Pathname()) |
| Prepare access to the rpm database. | |
| void | closeDatabase () |
| Block further access to the rpm database and go back to uninitialized state. | |
| void | rebuildDatabase () |
| Rebuild the rpm database (rpm --rebuilddb). | |
| void | importPubkey (const PublicKey &pubkey_r) |
| Import ascii armored public key in file pubkey_r. | |
| std::list< PublicKey > | pubkeys () const |
| Return the long ids of all installed public keys. | |
| std::set< Edition > | pubkeyEditions () const |
| Return the edition of all installed public keys. | |
| bool | packagesValid () const |
| |
| const std::list < Package::Ptr > & | getPackages () |
| If necessary build, and return the list of all installed packages. | |
| std::list< FileInfo > | fileList (const std::string &name_r, const Edition &edition_r) const |
| return complete file list for installed package name_r (in FileInfo.filename) if edition_r != Edition::noedition, check for exact edition if full==true, fill all attributes of FileInfo | |
| bool | hasFile (const std::string &file_r, const std::string &name_r="") const |
| Return true if at least one package owns a certain file (name_r empty) Return true if package name_r owns file file_r (name_r nonempty). | |
| std::string | whoOwnsFile (const std::string &file_r) const |
| Return name of package owning file or empty string if no installed package owns file. | |
| bool | hasProvides (const std::string &tag_r) const |
| Return true if at least one package provides a certain tag. | |
| bool | hasRequiredBy (const std::string &tag_r) const |
| Return true if at least one package requires a certain tag. | |
| bool | hasConflicts (const std::string &tag_r) const |
| Return true if at least one package conflicts with a certain tag. | |
| bool | hasPackage (const std::string &name_r) const |
| Return true if package is installed. | |
| bool | hasPackage (const std::string &name_r, const Edition &ed_r) const |
| Return true if package is installed in a certain edition. | |
| void | getData (const std::string &name_r, RpmHeader::constPtr &result_r) const |
| Get an installed packages data from rpmdb. | |
| void | getData (const std::string &name_r, const Edition &ed_r, RpmHeader::constPtr &result_r) const |
| Get an installed packages data from rpmdb. | |
| void | importZyppKeyRingTrustedKeys () |
| iterates through zypp keyring and import all non existant keys into rpm keyring | |
| void | exportTrustedKeysInZyppKeyRing () |
| insert all rpm trusted keys into zypp trusted keyring | |
| checkPackageResult | checkPackage (const Pathname &path_r) |
| Check signature of rpm file on disk. | |
| void | installPackage (const Pathname &filename, unsigned flags=0) |
| install rpm package | |
| void | removePackage (const std::string &name_r, unsigned flags=0) |
| remove rpm package | |
| void | removePackage (Package::constPtr package, unsigned flags=0) |
| Pathname | getBackupPath (void) |
| get backup dir for rpm config files | |
| bool | backupPackage (const std::string &packageName) |
| create tar.gz of all changed files in a Package | |
| bool | backupPackage (const Pathname &filename) |
| queries file for name and then calls above backupPackage function. | |
| void | setBackupPath (const Pathname &path) |
| set path where package backups are stored | |
| void | createPackageBackups (bool yes) |
| whether to create package backups during install or removal | |
| bool | queryChangedFiles (FileList &fileList, const std::string &packageName) |
| determine which files of an installed package have been modified. | |
| virtual std::ostream & | dumpOn (std::ostream &str) const |
| Dump debug info. | |
Static Public Member Functions | |
| static Package::Ptr | makePackageFromHeader (const RpmHeader::constPtr header, std::set< std::string > *filerequires, const Pathname &location, Repository repo) |
| Create a package from RpmHeader return NULL on error. | |
Protected Member Functions | |
| void | doRemovePackage (const std::string &name_r, unsigned flags, callback::SendReport< RpmRemoveReport > &report) |
| void | doInstallPackage (const Pathname &filename, unsigned flags, callback::SendReport< RpmInstallReport > &report) |
| const std::list < Package::Ptr > & | doGetPackages (callback::SendReport< ScanDBReport > &report) |
| void | doRebuildDatabase (callback::SendReport< RebuildDBReport > &report) |
Private Types | |
| enum | DbStateInfoBits { DbSI_NO_INIT = 0x0000, DbSI_HAVE_V4 = 0x0001, DbSI_MADE_V4 = 0x0002, DbSI_MODIFIED_V4 = 0x0004, DbSI_HAVE_V3 = 0x0008, DbSI_HAVE_V3TOV4 = 0x0010, DbSI_MADE_V3TOV4 = 0x0020 } |
| typedef std::vector < const char * > | RpmArgVec |
Private Member Functions | |
| void | dbsi_set (DbStateInfoBits &val_r, const unsigned &bits_r) const |
| void | dbsi_clr (DbStateInfoBits &val_r, const unsigned &bits_r) const |
| bool | dbsi_has (const DbStateInfoBits &val_r, const unsigned &bits_r) const |
| void | internal_initDatabase (const Pathname &root_r, const Pathname &dbPath_r, DbStateInfoBits &info_r) |
| Internal helper for initDatabase. | |
| void | modifyDatabase () |
| Called before the database is modified by installPackage/removePackage. | |
| void | run_rpm (const RpmArgVec &options, ExternalProgram::Stderr_Disposition stderr_disp=ExternalProgram::Stderr_To_Stdout) |
| Run rpm with the specified arguments and handle stderr. | |
| bool | systemReadLine (std::string &line) |
| Read a line from the general rpm query. | |
| int | systemStatus () |
| Return the exit status of the general rpm process, closing the connection if not already done. | |
| void | systemKill () |
| Forcably kill the system process. | |
| void | processConfigFiles (const std::string &line, const std::string &name, const char *typemsg, const char *difffailmsg, const char *diffgenmsg) |
| handle rpm messages like "/etc/testrc saved as /etc/testrc.rpmorig" | |
Static Private Member Functions | |
| static void | removeV4 (const Pathname &dbdir_r, bool v3backup_r) |
| Remove the rpm4 database in dbdir_r and optionally any backup created on conversion. | |
| static void | removeV3 (const Pathname &dbdir_r, bool v3backup_r) |
| Remove the rpm3 database in dbdir_r. | |
Private Attributes | |
| DbStateInfoBits | _dbStateInfo |
| Internal state info. | |
| Pathname | _root |
| Root directory for all operations. | |
| Pathname | _dbPath |
| Directory that contains the rpmdb. | |
| Packages & | _packages |
| std::set< std::string > | _filerequires |
| ExternalProgram * | process |
| The connection to the rpm process. | |
| int | exit_code |
| The exit code of the rpm process, or -1 if not yet known. | |
| Pathname | _backuppath |
| /var/adm/backup | |
| bool | _packagebackups |
| create package backups? | |
| bool | _warndirexists |
| whether <_root>/<WARNINGMAILPATH> was already created | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const DbStateInfoBits &obj) |
Classes | |
| class | Packages |
| Helper class for RpmDb::getPackages() to build the list<Package::Ptr> returned. More... | |
Definition at line 46 of file RpmDb.h.
| typedef class InstTargetError zypp::target::rpm::RpmDb::Error |
typedef std::vector<const char*> zypp::target::rpm::RpmDb::RpmArgVec [private] |
| typedef std::set<std::string> zypp::target::rpm::RpmDb::FileList |
enum zypp::target::rpm::RpmDb::DbStateInfoBits [private] |
Bits representing rpm installation options, useable as or combination.
checkPackage result
| zypp::target::rpm::RpmDb::RpmDb | ( | ) |
Constructor.
There's no rpmdb access until initDatabase was called.
Definition at line 277 of file RpmDb.cc.
References exit_code, process, and zypp::target::rpm::sKeyRingReceiver.
| zypp::target::rpm::RpmDb::~RpmDb | ( | ) |
Destructor.
Definition at line 300 of file RpmDb.cc.
References _packages, closeDatabase(), MIL, process, and zypp::target::rpm::sKeyRingReceiver.
| void zypp::target::rpm::RpmDb::dbsi_set | ( | DbStateInfoBits & | val_r, | |
| const unsigned & | bits_r | |||
| ) | const [inline, private] |
| void zypp::target::rpm::RpmDb::dbsi_clr | ( | DbStateInfoBits & | val_r, | |
| const unsigned & | bits_r | |||
| ) | const [inline, private] |
| bool zypp::target::rpm::RpmDb::dbsi_has | ( | const DbStateInfoBits & | val_r, | |
| const unsigned & | bits_r | |||
| ) | const [inline, private] |
Definition at line 82 of file RpmDb.h.
Referenced by closeDatabase(), initDatabase(), and modifyDatabase().
| void zypp::target::rpm::RpmDb::internal_initDatabase | ( | const Pathname & | root_r, | |
| const Pathname & | dbPath_r, | |||
| DbStateInfoBits & | info_r | |||
| ) | [private] |
Internal helper for initDatabase.
| RpmException |
Definition at line 477 of file RpmDb.cc.
References zypp::target::rpm::convertV3toV4(), zypp::filesystem::copy(), zypp::target::rpm::librpmDb::dbAccess(), zypp::target::rpm::librpmDb::DbDirInfo::dbDir(), DBG, DbSI_HAVE_V3, DbSI_HAVE_V3TOV4, DbSI_HAVE_V4, DbSI_MADE_V3TOV4, DbSI_MADE_V4, DbSI_MODIFIED_V4, DbSI_NO_INIT, dbsi_set(), zypp::target::rpm::librpmDb::DbDirInfo::dbV3(), zypp::target::rpm::librpmDb::DbDirInfo::dbV3ToV4(), zypp::target::rpm::librpmDb::DbDirInfo::dbV4(), zypp::target::rpm::librpmDb::dumpState(), ERR, zypp::target::rpm::librpmDb::DbDirInfo::hasDbV3(), zypp::target::rpm::librpmDb::DbDirInfo::hasDbV3ToV4(), zypp::target::rpm::librpmDb::DbDirInfo::hasDbV4(), zypp::target::rpm::librpmDb::DbDirInfo::illegalArgs(), MIL, zypp::target::rpm::librpmDb::DbDirInfo::restat(), zypp::target::rpm::stringPath(), zypp::target::rpm::librpmDb::DbDirInfo::usableArgs(), WAR, and ZYPP_THROW.
Referenced by initDatabase().
| void zypp::target::rpm::RpmDb::removeV4 | ( | const Pathname & | dbdir_r, | |
| bool | v3backup_r | |||
| ) | [static, private] |
Remove the rpm4 database in dbdir_r and optionally any backup created on conversion.
Definition at line 607 of file RpmDb.cc.
References ERR, MIL, and zypp::filesystem::unlink().
Referenced by closeDatabase(), and initDatabase().
| void zypp::target::rpm::RpmDb::removeV3 | ( | const Pathname & | dbdir_r, | |
| bool | v3backup_r | |||
| ) | [static, private] |
Remove the rpm3 database in dbdir_r.
Create a backup copy named packages.rpm3 if it does not already exist.
Definition at line 673 of file RpmDb.cc.
References ERR, MIL, zypp::filesystem::rename(), and zypp::filesystem::unlink().
Referenced by closeDatabase(), initDatabase(), and modifyDatabase().
| void zypp::target::rpm::RpmDb::modifyDatabase | ( | ) | [private] |
Called before the database is modified by installPackage/removePackage.
Invalidates Packages list and moves away any old database.
Definition at line 739 of file RpmDb.cc.
References _dbPath, _dbStateInfo, _packages, _root, zypp::target::rpm::RpmDb::Packages::_valid, dbsi_clr(), dbsi_has(), DbSI_HAVE_V3, DbSI_MADE_V3TOV4, DbSI_MODIFIED_V4, dbsi_set(), initialized(), MIL, and removeV3().
Referenced by doInstallPackage().
| Date zypp::target::rpm::RpmDb::timestamp | ( | ) | const |
timestamp of the rpm database (last modification)
Definition at line 311 of file RpmDb.cc.
References dbPath(), zypp::Date::now(), and root().
Referenced by zypp::target::TargetImpl::timestamp().
| const Pathname& zypp::target::rpm::RpmDb::root | ( | ) | const [inline] |
Definition at line 150 of file RpmDb.h.
References _root.
Referenced by checkPackage(), doRebuildDatabase(), rebuildDatabase(), and timestamp().
| const Pathname& zypp::target::rpm::RpmDb::dbPath | ( | ) | const [inline] |
Definition at line 158 of file RpmDb.h.
References _dbPath.
Referenced by doRebuildDatabase(), rebuildDatabase(), and timestamp().
| bool zypp::target::rpm::RpmDb::initialized | ( | ) | const [inline] |
Definition at line 166 of file RpmDb.h.
References _root.
Referenced by closeDatabase(), initDatabase(), modifyDatabase(), packagesValid(), and run_rpm().
| void zypp::target::rpm::RpmDb::initDatabase | ( | Pathname | root_r = Pathname(), |
|
| Pathname | dbPath_r = Pathname() | |||
| ) |
Prepare access to the rpm database.
Optional arguments may denote the root directory for all operations and the directory (below root) that contains the rpmdb (usg. you won't need to set this).
On empty Pathnames the default is used:
root: /
dbPath: /var/lib/rpm
Calling initDatabase a second time with different arguments will return an error but leave the database in it's original state.
Converting an old batabase is done if necessary. On update: The converted database will be removed by closeDatabase, if it was not modified (no packages were installed or deleted). Otherwise the new database is kept, and the old one is removed.
| RpmException |
Definition at line 365 of file RpmDb.cc.
References _dbPath, _dbStateInfo, _root, zypp::target::rpm::librpmDb::blockAccess(), zypp::target::rpm::librpmDb::dbRelease(), dbsi_clr(), dbsi_has(), DbSI_HAVE_V3, DbSI_HAVE_V4, DbSI_MADE_V3TOV4, DbSI_MADE_V4, DbSI_MODIFIED_V4, DbSI_NO_INIT, ERR, exportTrustedKeysInZyppKeyRing(), importZyppKeyRingTrustedKeys(), initialized(), internal_initDatabase(), MIL, rebuildDatabase(), removeV3(), removeV4(), zypp::target::rpm::stringPath(), zypp::target::rpm::librpmDb::unblockAccess(), ZYPP_CAUGHT, ZYPP_RETHROW, and ZYPP_THROW.
Referenced by zypp::target::TargetImpl::TargetImpl().
| void zypp::target::rpm::RpmDb::closeDatabase | ( | ) |
Block further access to the rpm database and go back to uninitialized state.
On update: Decides what to do with any converted database (see initDatabase).
| RpmException |
Definition at line 765 of file RpmDb.cc.
References _dbPath, _dbStateInfo, _packages, _root, zypp::target::rpm::librpmDb::blockAccess(), zypp::target::rpm::RpmDb::Packages::clear(), dbsi_has(), DbSI_HAVE_V3, DbSI_MADE_V3TOV4, DbSI_MODIFIED_V4, DbSI_NO_INIT, initialized(), MIL, removeV3(), and removeV4().
Referenced by ~RpmDb(), and zypp::target::TargetImpl::~TargetImpl().
| void zypp::target::rpm::RpmDb::rebuildDatabase | ( | ) |
Rebuild the rpm database (rpm --rebuilddb).
| RpmException |
Definition at line 813 of file RpmDb.cc.
References zypp::Exception::asUserString(), dbPath(), doRebuildDatabase(), zypp::target::rpm::RebuildDBReport::FAILED, zypp::target::rpm::RebuildDBReport::NO_ERROR, report, root(), and ZYPP_RETHROW.
Referenced by initDatabase().
| void zypp::target::rpm::RpmDb::importPubkey | ( | const PublicKey & | pubkey_r | ) |
Import ascii armored public key in file pubkey_r.
| RpmException |
Definition at line 985 of file RpmDb.cc.
References _packages, zypp::target::rpm::RpmDb::Packages::_valid, zypp::PublicKey::asString(), DBG, FAILIFNOTINITIALIZED, zypp::PublicKey::id(), MIL, zypp::str::numstring(), zypp::PublicKey::path(), pubkeyEditions(), run_rpm(), zypp::ExternalProgram::Stderr_To_Stdout, systemReadLine(), systemStatus(), zypp::str::toUpper(), WAR, and ZYPP_THROW.
Referenced by importZyppKeyRingTrustedKeys(), and zypp::target::rpm::KeyRingSignalReceiver::trustedKeyAdded().
| list< PublicKey > zypp::target::rpm::RpmDb::pubkeys | ( | ) | const |
Return the long ids of all installed public keys.
Definition at line 1049 of file RpmDb.cc.
References zypp::Edition::asString(), ERR, zypp::target::rpm::librpmDb::db_const_iterator::findByName(), getData(), zypp::Edition::noedition, and zypp::filesystem::TmpPath::path().
Referenced by importZyppKeyRingTrustedKeys().
| set< Edition > zypp::target::rpm::RpmDb::pubkeyEditions | ( | ) | const |
Return the edition of all installed public keys.
Definition at line 1087 of file RpmDb.cc.
References zypp::target::rpm::librpmDb::db_const_iterator::findByName(), and zypp::Edition::noedition.
Referenced by exportTrustedKeysInZyppKeyRing(), and importPubkey().
| bool zypp::target::rpm::RpmDb::packagesValid | ( | ) | const |
(NOTE: returns valid, if not initialized).
Definition at line 1107 of file RpmDb.cc.
References _packages, zypp::target::rpm::RpmDb::Packages::_valid, and initialized().
Referenced by doGetPackages().
| const list< Package::Ptr > & zypp::target::rpm::RpmDb::getPackages | ( | ) |
If necessary build, and return the list of all installed packages.
Definition at line 1120 of file RpmDb.cc.
References zypp::Exception::asUserString(), doGetPackages(), zypp::target::rpm::ScanDBReport::FAILED, zypp::target::rpm::ScanDBReport::NO_ERROR, report, and ZYPP_RETHROW.
Referenced by zypp::target::TargetImpl::loadKindResolvables().
| std::list<FileInfo> zypp::target::rpm::RpmDb::fileList | ( | const std::string & | name_r, | |
| const Edition & | edition_r | |||
| ) | const |
return complete file list for installed package name_r (in FileInfo.filename) if edition_r != Edition::noedition, check for exact edition if full==true, fill all attributes of FileInfo
| bool zypp::target::rpm::RpmDb::hasFile | ( | const std::string & | file_r, | |
| const std::string & | name_r = "" | |||
| ) | const |
Return true if at least one package owns a certain file (name_r empty) Return true if package name_r owns file file_r (name_r nonempty).
Referenced by zypp::target::TargetImpl::providesFile().
| std::string zypp::target::rpm::RpmDb::whoOwnsFile | ( | const std::string & | file_r | ) | const |
Return name of package owning file or empty string if no installed package owns file.
Referenced by zypp::target::TargetImpl::whoOwnsFile().
| bool zypp::target::rpm::RpmDb::hasProvides | ( | const std::string & | tag_r | ) | const |
Return true if at least one package provides a certain tag.
| bool zypp::target::rpm::RpmDb::hasRequiredBy | ( | const std::string & | tag_r | ) | const |
Return true if at least one package requires a certain tag.
| bool zypp::target::rpm::RpmDb::hasConflicts | ( | const std::string & | tag_r | ) | const |
Return true if at least one package conflicts with a certain tag.
| bool zypp::target::rpm::RpmDb::hasPackage | ( | const std::string & | name_r | ) | const |
Return true if package is installed.
| bool zypp::target::rpm::RpmDb::hasPackage | ( | const std::string & | name_r, | |
| const Edition & | ed_r | |||
| ) | const |
Return true if package is installed in a certain edition.
| void zypp::target::rpm::RpmDb::getData | ( | const std::string & | name_r, | |
| RpmHeader::constPtr & | result_r | |||
| ) | const |
Get an installed packages data from rpmdb.
Package is identified by name. Data returned via result are NULL, if packge is not installed (PMError is not set), or RPM database could not be read (PMError is set).
| RpmException | FIXME this and following comment |
Referenced by exportTrustedKeysInZyppKeyRing(), and pubkeys().
| void zypp::target::rpm::RpmDb::getData | ( | const std::string & | name_r, | |
| const Edition & | ed_r, | |||
| RpmHeader::constPtr & | result_r | |||
| ) | const |
Get an installed packages data from rpmdb.
Package is identified by name and edition. Data returned via result are NULL, if packge is not installed (PMError is not set), or RPM database could not be read (PMError is set).
| RpmException |
| static Package::Ptr zypp::target::rpm::RpmDb::makePackageFromHeader | ( | const RpmHeader::constPtr | header, | |
| std::set< std::string > * | filerequires, | |||
| const Pathname & | location, | |||
| Repository | repo | |||
| ) | [static] |
| void zypp::target::rpm::RpmDb::importZyppKeyRingTrustedKeys | ( | ) |
iterates through zypp keyring and import all non existant keys into rpm keyring
Definition at line 889 of file RpmDb.cc.
References ERR, importPubkey(), MIL, and pubkeys().
Referenced by initDatabase().
| void zypp::target::rpm::RpmDb::exportTrustedKeysInZyppKeyRing | ( | ) |
insert all rpm trusted keys into zypp trusted keyring
Definition at line 923 of file RpmDb.cc.
References ERR, getData(), MIL, zypp::filesystem::TmpPath::path(), pubkeyEditions(), and zypp::str::toUpper().
Referenced by initDatabase().
| void zypp::target::rpm::RpmDb::run_rpm | ( | const RpmArgVec & | options, | |
| ExternalProgram::Stderr_Disposition | stderr_disp = ExternalProgram::Stderr_To_Stdout | |||
| ) | [private] |
Run rpm with the specified arguments and handle stderr.
| n_opts | The number of arguments | |
| options | Array of the arguments, n_opts elements | |
| stderr_disp | How to handle stderr, merged with stdout by default |
| RpmException |
Definition at line 1634 of file RpmDb.cc.
References _dbPath, _root, zypp::filesystem::copy(), zypp::target::rpm::librpmDb::dbRelease(), exit_code, initialized(), process, and ZYPP_THROW.
Referenced by doInstallPackage(), doRebuildDatabase(), and importPubkey().
| bool zypp::target::rpm::RpmDb::systemReadLine | ( | std::string & | line | ) | [private] |
Read a line from the general rpm query.
Referenced by doInstallPackage(), doRebuildDatabase(), and importPubkey().
| int zypp::target::rpm::RpmDb::systemStatus | ( | ) | [private] |
Return the exit status of the general rpm process, closing the connection if not already done.
Definition at line 1701 of file RpmDb.cc.
References zypp::ExternalProgram::close(), exit_code, zypp::ExternalProgram::kill(), and process.
Referenced by doInstallPackage(), doRebuildDatabase(), and importPubkey().
| void zypp::target::rpm::RpmDb::systemKill | ( | ) | [private] |
Forcably kill the system process.
Definition at line 1720 of file RpmDb.cc.
References zypp::ExternalProgram::kill(), and process.
| void zypp::target::rpm::RpmDb::processConfigFiles | ( | const std::string & | line, | |
| const std::string & | name, | |||
| const char * | typemsg, | |||
| const char * | difffailmsg, | |||
| const char * | diffgenmsg | |||
| ) | [private] |
handle rpm messages like "/etc/testrc saved as /etc/testrc.rpmorig"
| line | rpm output starting with warning: | |
| name | name of package, appears in subject line | |
| typemsg | " saved as " or " created as " | |
| difffailmsg | what to put into mail if diff failed, must contain two s for the two files | |
| diffgenmsg | what to put into mail if diff succeeded, must contain two s for the two files |
Referenced by doInstallPackage().
| RpmDb::checkPackageResult zypp::target::rpm::RpmDb::checkPackage | ( | const Pathname & | path_r | ) |
| void zypp::target::rpm::RpmDb::installPackage | ( | const Pathname & | filename, | |
| unsigned | flags = 0 | |||
| ) |
install rpm package
| filename | file to install | |
| flags | which rpm options to use |
| RpmException |
Definition at line 1824 of file RpmDb.cc.
References zypp::target::rpm::RpmInstallReport::ABORT, doInstallPackage(), zypp::target::rpm::RpmInstallReport::IGNORE, report, and ZYPP_RETHROW.
Referenced by zypp::target::TargetImpl::commit(), and zypp::target::TargetImpl::installSrcPackage().
| void zypp::target::rpm::RpmDb::removePackage | ( | const std::string & | name_r, | |
| unsigned | flags = 0 | |||
| ) |
remove rpm package
| RpmException |
Referenced by zypp::target::TargetImpl::commit(), and removePackage().
| void zypp::target::rpm::RpmDb::removePackage | ( | Package::constPtr | package, | |
| unsigned | flags = 0 | |||
| ) |
| Pathname zypp::target::rpm::RpmDb::getBackupPath | ( | void | ) | [inline] |
| bool zypp::target::rpm::RpmDb::backupPackage | ( | const std::string & | packageName | ) |
create tar.gz of all changed files in a Package
| packageName | name of the Package to backup |
Referenced by backupPackage(), and doInstallPackage().
| bool zypp::target::rpm::RpmDb::backupPackage | ( | const Pathname & | filename | ) |
queries file for name and then calls above backupPackage function.
For convenience.
| filename | rpm file that is about to be installed |
Definition at line 2094 of file RpmDb.cc.
References backupPackage(), zypp::target::rpm::RpmHeader::NOSIGNATURE, and zypp::target::rpm::RpmHeader::readPackage().
| void zypp::target::rpm::RpmDb::setBackupPath | ( | const Pathname & | path | ) |
set path where package backups are stored
Definition at line 2234 of file RpmDb.cc.
References _backuppath.
| void zypp::target::rpm::RpmDb::createPackageBackups | ( | bool | yes | ) | [inline] |
whether to create package backups during install or removal
| yes | true or false |
Definition at line 539 of file RpmDb.h.
References _packagebackups.
| bool zypp::target::rpm::RpmDb::queryChangedFiles | ( | FileList & | fileList, | |
| const std::string & | packageName | |||
| ) |
determine which files of an installed package have been modified.
| fileList | (output) where to store modified files | |
| packageName | name of package to query |
| virtual std::ostream& zypp::target::rpm::RpmDb::dumpOn | ( | std::ostream & | str | ) | const [virtual] |
| void zypp::target::rpm::RpmDb::doRemovePackage | ( | const std::string & | name_r, | |
| unsigned | flags, | |||
| callback::SendReport< RpmRemoveReport > & | report | |||
| ) | [protected] |
| void zypp::target::rpm::RpmDb::doInstallPackage | ( | const Pathname & | filename, | |
| unsigned | flags, | |||
| callback::SendReport< RpmInstallReport > & | report | |||
| ) | [protected] |
Definition at line 1854 of file RpmDb.cc.
References _, _packagebackups, backupPackage(), ERR, FAILIFNOTINITIALIZED, zypp::str::form(), MIL, modifyDatabase(), processConfigFiles(), RPMINST_FORCE, RPMINST_IGNORESIZE, RPMINST_JUSTDB, RPMINST_NODEPS, RPMINST_NODIGEST, RPMINST_NODOCS, RPMINST_NOSCRIPTS, RPMINST_NOSIGNATURE, RPMINST_NOUPGRADE, RPMINST_TEST, zypp::target::rpm::rpmQuoteFilename(), run_rpm(), zypp::ExternalProgram::Stderr_To_Stdout, systemReadLine(), systemStatus(), and ZYPP_THROW.
Referenced by installPackage().
| const list< Package::Ptr > & zypp::target::rpm::RpmDb::doGetPackages | ( | callback::SendReport< ScanDBReport > & | report | ) | [protected] |
Definition at line 1257 of file RpmDb.cc.
References _filerequires, zypp::target::rpm::RpmDb::Packages::_list, _packages, zypp::target::rpm::RpmDb::Packages::buildIndex(), zypp::target::rpm::RpmDb::Packages::clear(), zypp::target::rpm::librpmDb::dbAccess(), DBG, zypp::target::rpm::librpmDb::db_const_iterator::findAll(), zypp::target::rpm::librpmDb::db_const_iterator::findByFile(), zypp::target::rpm::RpmDb::Packages::lookup(), makePackageFromHeader(), packagesValid(), zypp::CapFactory::parse(), and WAR.
Referenced by getPackages().
| void zypp::target::rpm::RpmDb::doRebuildDatabase | ( | callback::SendReport< RebuildDBReport > & | report | ) | [protected] |
Definition at line 831 of file RpmDb.cc.
References _packages, zypp::target::rpm::RpmDb::Packages::_valid, dbPath(), FAILIFNOTINITIALIZED, zypp::str::form(), zypp::ExternalProgram::getpid(), MIL, process, root(), run_rpm(), zypp::ExternalProgram::Stderr_To_Stdout, systemReadLine(), systemStatus(), WAR, and ZYPP_THROW.
Referenced by rebuildDatabase().
| std::ostream& operator<< | ( | std::ostream & | str, | |
| const DbStateInfoBits & | obj | |||
| ) | [friend] |
Internal state info.
Definition at line 90 of file RpmDb.h.
Referenced by closeDatabase(), initDatabase(), and modifyDatabase().
Pathname zypp::target::rpm::RpmDb::_root [private] |
Root directory for all operations.
Definition at line 95 of file RpmDb.h.
Referenced by closeDatabase(), initDatabase(), initialized(), modifyDatabase(), root(), and run_rpm().
Pathname zypp::target::rpm::RpmDb::_dbPath [private] |
Directory that contains the rpmdb.
Definition at line 100 of file RpmDb.h.
Referenced by closeDatabase(), dbPath(), initDatabase(), modifyDatabase(), and run_rpm().
Packages& zypp::target::rpm::RpmDb::_packages [private] |
Definition at line 239 of file RpmDb.h.
Referenced by closeDatabase(), doGetPackages(), doRebuildDatabase(), importPubkey(), modifyDatabase(), packagesValid(), and ~RpmDb().
std::set<std::string> zypp::target::rpm::RpmDb::_filerequires [private] |
ExternalProgram* zypp::target::rpm::RpmDb::process [private] |
The connection to the rpm process.
Definition at line 363 of file RpmDb.h.
Referenced by doRebuildDatabase(), RpmDb(), run_rpm(), systemKill(), systemStatus(), and ~RpmDb().
int zypp::target::rpm::RpmDb::exit_code [private] |
Pathname zypp::target::rpm::RpmDb::_backuppath [private] |
/var/adm/backup
Definition at line 403 of file RpmDb.h.
Referenced by getBackupPath(), and setBackupPath().
bool zypp::target::rpm::RpmDb::_packagebackups [private] |
create package backups?
Definition at line 406 of file RpmDb.h.
Referenced by createPackageBackups(), and doInstallPackage().
bool zypp::target::rpm::RpmDb::_warndirexists [private] |
1.5.3