libzypp  17.1.1
zypp::target::rpm::RpmDb Class Reference

Interface to the rpm program. More...

#include <RpmDb.h>

Inheritance diagram for zypp::target::rpm::RpmDb:

Classes

struct  CheckPackageDetail
 Detailed rpm signature check log messages A single multiline message if CHK_OK. More...
 

Public Types

enum  SyncTrustedKeyBits { SYNC_TO_KEYRING = 1<<0, SYNC_FROM_KEYRING = 1<<1, SYNC_BOTH = SYNC_TO_KEYRING | SYNC_FROM_KEYRING }
 Sync mode for syncTrustedKeys. More...
 
enum  CheckPackageResult {
  CHK_OK = 0, CHK_NOTFOUND = 1, CHK_FAIL = 2, CHK_NOTTRUSTED = 3,
  CHK_NOKEY = 4, CHK_ERROR = 5, CHK_NOSIG = 6
}
 checkPackage result More...
 
typedef class InstTargetError Error
 Default error class. More...
 
typedef std::set< std::string > FileList
 

Public Member Functions

 RpmDb ()
 Constructor. More...
 
 ~RpmDb ()
 Destructor. More...
 
Date timestamp () const
 timestamp of the rpm database (last modification) More...
 
const Pathnameroot () const
 
const PathnamedbPath () const
 
bool initialized () const
 
void initDatabase (Pathname root_r=Pathname(), Pathname dbPath_r=Pathname(), bool doRebuild_r=false)
 Prepare access to the rpm database. More...
 
void closeDatabase ()
 Block further access to the rpm database and go back to uninitialized state. More...
 
void rebuildDatabase ()
 Rebuild the rpm database (rpm –rebuilddb). More...
 
void importPubkey (const PublicKey &pubkey_r)
 Import ascii armored public key in file pubkey_r. More...
 
void removePubkey (const PublicKey &pubkey_r)
 Remove a public key from the rpm database. More...
 
std::list< PublicKeypubkeys () const
 Return the long ids of all installed public keys. More...
 
std::set< EditionpubkeyEditions () const
 Return the edition of all installed public keys. More...
 
std::list< FileInfofileList (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 More...
 
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). More...
 
std::string whoOwnsFile (const std::string &file_r) const
 Return name of package owning file or empty string if no installed package owns file. More...
 
bool hasProvides (const std::string &tag_r) const
 Return true if at least one package provides a certain tag. More...
 
bool hasRequiredBy (const std::string &tag_r) const
 Return true if at least one package requires a certain tag. More...
 
bool hasConflicts (const std::string &tag_r) const
 Return true if at least one package conflicts with a certain tag. More...
 
bool hasPackage (const std::string &name_r) const
 Return true if package is installed. More...
 
bool hasPackage (const std::string &name_r, const Edition &ed_r) const
 Return true if package is installed in a certain edition. More...
 
void getData (const std::string &name_r, RpmHeader::constPtr &result_r) const
 Get an installed packages data from rpmdb. More...
 
void getData (const std::string &name_r, const Edition &ed_r, RpmHeader::constPtr &result_r) const
 Get an installed packages data from rpmdb. More...
 
void syncTrustedKeys (SyncTrustedKeyBits mode_r=SYNC_BOTH)
 Sync trusted keys stored in rpm database and zypp trusted keyring. More...
 
void importZyppKeyRingTrustedKeys ()
 iterates through zypp keyring and import all non existant keys into rpm keyring More...
 
void exportTrustedKeysInZyppKeyRing ()
 insert all rpm trusted keys into zypp trusted keyring More...
 
CheckPackageResult checkPackage (const Pathname &path_r, CheckPackageDetail &detail_r)
 Check signature of rpm file on disk (legacy version returning CHK_OK if file is unsigned, like 'rpm -K') More...
 
CheckPackageResult checkPackage (const Pathname &path_r)
 
CheckPackageResult checkPackageSignature (const Pathname &path_r, CheckPackageDetail &detail_r)
 Check signature of rpm file on disk (strict check returning CHK_NOSIG if file is unsigned). More...
 
void installPackage (const Pathname &filename, RpmInstFlags flags=RPMINST_NONE)
 install rpm package More...
 
void removePackage (const std::string &name_r, RpmInstFlags flags=RPMINST_NONE)
 remove rpm package More...
 
void removePackage (Package::constPtr package, RpmInstFlags flags=RPMINST_NONE)
 
Pathname getBackupPath (void)
 get backup dir for rpm config files More...
 
bool backupPackage (const std::string &packageName)
 create tar.gz of all changed files in a Package More...
 
bool backupPackage (const Pathname &filename)
 queries file for name and then calls above backupPackage function. More...
 
void setBackupPath (const Pathname &path)
 set path where package backups are stored More...
 
void createPackageBackups (bool yes)
 whether to create package backups during install or removal More...
 
bool queryChangedFiles (FileList &fileList, const std::string &packageName)
 determine which files of an installed package have been modified. More...
 
virtual std::ostream & dumpOn (std::ostream &str) const
 Dump debug info. More...
 
- Public Member Functions inherited from zypp::base::ReferenceCounted
 ReferenceCounted ()
 Default ctor. More...
 
 ReferenceCounted (const ReferenceCounted &rhs)
 Copy ctor. More...
 
virtual ~ReferenceCounted ()
 Dtor. More...
 
ReferenceCountedoperator= (const ReferenceCounted &)
 Assignment. More...
 
unsigned refCount () const
 Return reference counter value. More...
 
void ref () const
 Add a reference. More...
 
void unref () const
 Release a reference. More...
 

Protected Member Functions

void doRemovePackage (const std::string &name_r, RpmInstFlags flags, callback::SendReport< RpmRemoveReport > &report)
 
void doInstallPackage (const Pathname &filename, RpmInstFlags flags, callback::SendReport< RpmInstallReport > &report)
 
void doRebuildDatabase (callback::SendReport< RebuildDBReport > &report)
 
- Protected Member Functions inherited from zypp::base::ReferenceCounted
virtual void ref_to (unsigned) const
 Trigger derived classes after refCount was increased. More...
 
virtual void unref_to (unsigned) const
 Trigger derived classes after refCount was decreased. More...
 

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. More...
 
void modifyDatabase ()
 Called before the database is modified by installPackage/removePackage. More...
 
void run_rpm (const RpmArgVec &options, ExternalProgram::Stderr_Disposition stderr_disp=ExternalProgram::Stderr_To_Stdout)
 Run rpm with the specified arguments and handle stderr. More...
 
bool systemReadLine (std::string &line)
 Read a line from the general rpm query. More...
 
int systemStatus ()
 Return the exit status of the general rpm process, closing the connection if not already done. More...
 
void systemKill ()
 Forcably kill the system process. More...
 
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" More...
 

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. More...
 
static void removeV3 (const Pathname &dbdir_r, bool v3backup_r)
 Remove the rpm3 database in dbdir_r. More...
 

Private Attributes

DbStateInfoBits _dbStateInfo
 Internal state info. More...
 
Pathname _root
 Root directory for all operations. More...
 
Pathname _dbPath
 Directory that contains the rpmdb. More...
 
ExternalProgramprocess
 The connection to the rpm process. More...
 
int exit_code
 The exit code of the rpm process, or -1 if not yet known. More...
 
std::string error_message
 Error message from running rpm as external program. More...
 
Pathname _backuppath
 /var/adm/backup More...
 
bool _packagebackups
 create package backups? More...
 
bool _warndirexists
 whether <_root>/<WARNINGMAILPATH> was already created More...
 

Friends

std::ostream & operator<< (std::ostream &str, const DbStateInfoBits &obj)
 

Additional Inherited Members

- Static Public Member Functions inherited from zypp::base::ReferenceCounted
static void add_ref (const ReferenceCounted *ptr_r)
 Called by zypp::intrusive_ptr to add a reference. More...
 
static void release (const ReferenceCounted *ptr_r)
 Called by zypp::intrusive_ptr to add a reference. More...
 

Detailed Description

Interface to the rpm program.

Definition at line 47 of file RpmDb.h.

Member Typedef Documentation

◆ Error

typedef class InstTargetError zypp::target::rpm::RpmDb::Error

Default error class.

Definition at line 54 of file RpmDb.h.

◆ RpmArgVec

typedef std::vector<const char*> zypp::target::rpm::RpmDb::RpmArgVec
private

Definition at line 353 of file RpmDb.h.

◆ FileList

typedef std::set<std::string> zypp::target::rpm::RpmDb::FileList

Definition at line 423 of file RpmDb.h.

Member Enumeration Documentation

◆ DbStateInfoBits

Enumerator
DbSI_NO_INIT 
DbSI_HAVE_V4 
DbSI_MADE_V4 
DbSI_MODIFIED_V4 
DbSI_HAVE_V3 
DbSI_HAVE_V3TOV4 
DbSI_MADE_V3TOV4 

Definition at line 63 of file RpmDb.h.

◆ SyncTrustedKeyBits

Sync mode for syncTrustedKeys.

Enumerator
SYNC_TO_KEYRING 
SYNC_FROM_KEYRING 

export rpm trusted keys into zypp trusted keyring

SYNC_BOTH 

import zypp trusted keys into rpm database.

Definition at line 327 of file RpmDb.h.

◆ CheckPackageResult

checkPackage result

See also
checkPackage
Enumerator
CHK_OK 

Signature is OK.

CHK_NOTFOUND 

Signature is unknown type.

CHK_FAIL 

Signature does not verify.

CHK_NOTTRUSTED 

Signature is OK, but key is not trusted.

CHK_NOKEY 

Public key is unavailable.

CHK_ERROR 

File does not exist or can't be opened.

CHK_NOSIG 

File has no gpg signature (only digests).

Definition at line 429 of file RpmDb.h.

Constructor & Destructor Documentation

◆ RpmDb()

zypp::target::rpm::RpmDb::RpmDb ( )

Constructor.

There's no rpmdb access until initDatabase was called.

Definition at line 229 of file RpmDb.cc.

◆ ~RpmDb()

zypp::target::rpm::RpmDb::~RpmDb ( )

Destructor.

Definition at line 251 of file RpmDb.cc.

Member Function Documentation

◆ dbsi_set()

void zypp::target::rpm::RpmDb::dbsi_set ( DbStateInfoBits val_r,
const unsigned &  bits_r 
) const
inlineprivate

Definition at line 75 of file RpmDb.h.

◆ dbsi_clr()

void zypp::target::rpm::RpmDb::dbsi_clr ( DbStateInfoBits val_r,
const unsigned &  bits_r 
) const
inlineprivate

Definition at line 79 of file RpmDb.h.

◆ dbsi_has()

bool zypp::target::rpm::RpmDb::dbsi_has ( const DbStateInfoBits val_r,
const unsigned &  bits_r 
) const
inlineprivate

Definition at line 83 of file RpmDb.h.

◆ internal_initDatabase()

void zypp::target::rpm::RpmDb::internal_initDatabase ( const Pathname root_r,
const Pathname dbPath_r,
DbStateInfoBits info_r 
)
private

Internal helper for initDatabase.

Exceptions
RpmException

Definition at line 432 of file RpmDb.cc.

◆ removeV4()

void zypp::target::rpm::RpmDb::removeV4 ( const Pathname dbdir_r,
bool  v3backup_r 
)
staticprivate

Remove the rpm4 database in dbdir_r and optionally any backup created on conversion.

Definition at line 557 of file RpmDb.cc.

◆ removeV3()

void zypp::target::rpm::RpmDb::removeV3 ( const Pathname dbdir_r,
bool  v3backup_r 
)
staticprivate

Remove the rpm3 database in dbdir_r.

Create a backup copy named packages.rpm3 if it does not already exist.

Definition at line 623 of file RpmDb.cc.

◆ 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 689 of file RpmDb.cc.

◆ timestamp()

Date zypp::target::rpm::RpmDb::timestamp ( ) const

timestamp of the rpm database (last modification)

Definition at line 260 of file RpmDb.cc.

◆ root()

const Pathname& zypp::target::rpm::RpmDb::root ( ) const
inline
Returns
Root directory for all operations (empty if not initialized).

Definition at line 151 of file RpmDb.h.

◆ dbPath()

const Pathname& zypp::target::rpm::RpmDb::dbPath ( ) const
inline
Returns
Directory that contains the rpmdb (empty if not initialized).

Definition at line 159 of file RpmDb.h.

◆ initialized()

bool zypp::target::rpm::RpmDb::initialized ( ) const
inline
Returns
Whether we are initialized.

Definition at line 167 of file RpmDb.h.

◆ initDatabase()

void zypp::target::rpm::RpmDb::initDatabase ( Pathname  root_r = Pathname(),
Pathname  dbPath_r = Pathname(),
bool  doRebuild_r = false 
)

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.

If the database alredy exists and doRebuild_r is true, rebuildDatabase is called.

Exceptions
RpmException

Definition at line 314 of file RpmDb.cc.

◆ closeDatabase()

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).

Exceptions
RpmException

Definition at line 712 of file RpmDb.cc.

◆ rebuildDatabase()

void zypp::target::rpm::RpmDb::rebuildDatabase ( )

Rebuild the rpm database (rpm –rebuilddb).

Exceptions
RpmException

Definition at line 759 of file RpmDb.cc.

◆ importPubkey()

void zypp::target::rpm::RpmDb::importPubkey ( const PublicKey pubkey_r)

Import ascii armored public key in file pubkey_r.

Exceptions
RpmException

Definition at line 1046 of file RpmDb.cc.

◆ removePubkey()

void zypp::target::rpm::RpmDb::removePubkey ( const PublicKey pubkey_r)

Remove a public key from the rpm database.

Exceptions
RpmException

Definition at line 1164 of file RpmDb.cc.

◆ pubkeys()

std::list< PublicKey > zypp::target::rpm::RpmDb::pubkeys ( ) const

Return the long ids of all installed public keys.

Definition at line 1234 of file RpmDb.cc.

◆ pubkeyEditions()

std::set< Edition > zypp::target::rpm::RpmDb::pubkeyEditions ( ) const

Return the edition of all installed public keys.

Definition at line 1272 of file RpmDb.cc.

◆ fileList()

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

Definition at line 1296 of file RpmDb.cc.

◆ hasFile()

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).

Definition at line 1325 of file RpmDb.cc.

◆ whoOwnsFile()

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.

Definition at line 1351 of file RpmDb.cc.

◆ hasProvides()

bool zypp::target::rpm::RpmDb::hasProvides ( const std::string &  tag_r) const

Return true if at least one package provides a certain tag.

Definition at line 1369 of file RpmDb.cc.

◆ hasRequiredBy()

bool zypp::target::rpm::RpmDb::hasRequiredBy ( const std::string &  tag_r) const

Return true if at least one package requires a certain tag.

Definition at line 1383 of file RpmDb.cc.

◆ hasConflicts()

bool zypp::target::rpm::RpmDb::hasConflicts ( const std::string &  tag_r) const

Return true if at least one package conflicts with a certain tag.

Definition at line 1397 of file RpmDb.cc.

◆ hasPackage() [1/2]

bool zypp::target::rpm::RpmDb::hasPackage ( const std::string &  name_r) const

Return true if package is installed.

Definition at line 1411 of file RpmDb.cc.

◆ hasPackage() [2/2]

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.

Definition at line 1425 of file RpmDb.cc.

◆ getData() [1/2]

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).

Exceptions
RpmExceptionFIXME this and following comment

Definition at line 1439 of file RpmDb.cc.

◆ getData() [2/2]

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).

Exceptions
RpmException

Definition at line 1457 of file RpmDb.cc.

◆ syncTrustedKeys()

void zypp::target::rpm::RpmDb::syncTrustedKeys ( SyncTrustedKeyBits  mode_r = SYNC_BOTH)

Sync trusted keys stored in rpm database and zypp trusted keyring.

Definition at line 947 of file RpmDb.cc.

◆ importZyppKeyRingTrustedKeys()

void zypp::target::rpm::RpmDb::importZyppKeyRingTrustedKeys ( )

iterates through zypp keyring and import all non existant keys into rpm keyring

Definition at line 1034 of file RpmDb.cc.

◆ exportTrustedKeysInZyppKeyRing()

void zypp::target::rpm::RpmDb::exportTrustedKeysInZyppKeyRing ( )

insert all rpm trusted keys into zypp trusted keyring

Definition at line 1037 of file RpmDb.cc.

◆ run_rpm()

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.

Parameters
n_optsThe number of arguments
optionsArray of the arguments, n_opts elements
stderr_dispHow to handle stderr, merged with stdout by default
Exceptions
RpmException

Definition at line 1694 of file RpmDb.cc.

◆ systemReadLine()

bool zypp::target::rpm::RpmDb::systemReadLine ( std::string &  line)
private

Read a line from the general rpm query.

Definition at line 1740 of file RpmDb.cc.

◆ systemStatus()

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 1814 of file RpmDb.cc.

◆ systemKill()

void zypp::target::rpm::RpmDb::systemKill ( )
private

Forcably kill the system process.

Definition at line 1837 of file RpmDb.cc.

◆ processConfigFiles()

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"

Parameters
linerpm output starting with warning:
namename of package, appears in subject line
typemsg" saved as " or " created as "
difffailmsgwhat to put into mail if diff failed, must contain two s for the two files
diffgenmsgwhat to put into mail if diff succeeded, must contain two s for the two files

Definition at line 1844 of file RpmDb.cc.

◆ checkPackage() [1/2]

RpmDb::CheckPackageResult zypp::target::rpm::RpmDb::checkPackage ( const Pathname path_r,
CheckPackageDetail detail_r 
)

Check signature of rpm file on disk (legacy version returning CHK_OK if file is unsigned, like 'rpm -K')

Parameters
path_rwhich file to check
detail_rReturn detailed rpm log messages
Returns
CheckPackageResult (CHK_OK if file is unsigned)
See also
also checkPackageSignature

Definition at line 1616 of file RpmDb.cc.

◆ checkPackage() [2/2]

RpmDb::CheckPackageResult zypp::target::rpm::RpmDb::checkPackage ( const Pathname path_r)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1619 of file RpmDb.cc.

◆ checkPackageSignature()

RpmDb::CheckPackageResult zypp::target::rpm::RpmDb::checkPackageSignature ( const Pathname path_r,
RpmDb::CheckPackageDetail detail_r 
)

Check signature of rpm file on disk (strict check returning CHK_NOSIG if file is unsigned).

Parameters
path_rwhich file to check
detail_rReturn detailed rpm log messages
Returns
CheckPackageResult (CHK_NOSIG if file is unsigned)
See also
also checkPackage

Definition at line 1622 of file RpmDb.cc.

◆ installPackage()

void zypp::target::rpm::RpmDb::installPackage ( const Pathname filename,
RpmInstFlags  flags = RPMINST_NONE 
)

install rpm package

Parameters
filenamefile to install
flagswhich rpm options to use
Returns
success
Exceptions
RpmException

Definition at line 1941 of file RpmDb.cc.

◆ removePackage() [1/2]

void zypp::target::rpm::RpmDb::removePackage ( const std::string &  name_r,
RpmInstFlags  flags = RPMINST_NONE 
)

remove rpm package

Parameters
name_rName of the rpm package to remove.
iflagswhich rpm options to use
Returns
success
Exceptions
RpmException

Definition at line 2128 of file RpmDb.cc.

◆ removePackage() [2/2]

void zypp::target::rpm::RpmDb::removePackage ( Package::constPtr  package,
RpmInstFlags  flags = RPMINST_NONE 
)

Definition at line 2113 of file RpmDb.cc.

◆ getBackupPath()

Pathname zypp::target::rpm::RpmDb::getBackupPath ( void  )
inline

get backup dir for rpm config files

Definition at line 502 of file RpmDb.h.

◆ backupPackage() [1/2]

bool zypp::target::rpm::RpmDb::backupPackage ( const std::string &  packageName)

create tar.gz of all changed files in a Package

Parameters
packageNamename of the Package to backup
See also
setBackupPath

Definition at line 2274 of file RpmDb.cc.

◆ backupPackage() [2/2]

bool zypp::target::rpm::RpmDb::backupPackage ( const Pathname filename)

queries file for name and then calls above backupPackage function.

For convenience.

Parameters
filenamerpm file that is about to be installed

Definition at line 2259 of file RpmDb.cc.

◆ setBackupPath()

void zypp::target::rpm::RpmDb::setBackupPath ( const Pathname path)

set path where package backups are stored

See also
backupPackage

Definition at line 2401 of file RpmDb.cc.

◆ createPackageBackups()

void zypp::target::rpm::RpmDb::createPackageBackups ( bool  yes)
inline

whether to create package backups during install or removal

Parameters
yestrue or false

Definition at line 537 of file RpmDb.h.

◆ queryChangedFiles()

bool zypp::target::rpm::RpmDb::queryChangedFiles ( FileList fileList,
const std::string &  packageName 
)

determine which files of an installed package have been modified.

Parameters
fileList(output) where to store modified files
packageNamename of package to query
Returns
false if package couln't be queried for some reason

Definition at line 1628 of file RpmDb.cc.

◆ dumpOn()

std::ostream & zypp::target::rpm::RpmDb::dumpOn ( std::ostream &  str) const
virtual

Dump debug info.

Reimplemented from zypp::base::ReferenceCounted.

Definition at line 283 of file RpmDb.cc.

◆ doRemovePackage()

void zypp::target::rpm::RpmDb::doRemovePackage ( const std::string &  name_r,
RpmInstFlags  flags,
callback::SendReport< RpmRemoveReport > &  report 
)
protected

Definition at line 2159 of file RpmDb.cc.

◆ doInstallPackage()

void zypp::target::rpm::RpmDb::doInstallPackage ( const Pathname filename,
RpmInstFlags  flags,
callback::SendReport< RpmInstallReport > &  report 
)
protected

Definition at line 1971 of file RpmDb.cc.

◆ doRebuildDatabase()

void zypp::target::rpm::RpmDb::doRebuildDatabase ( callback::SendReport< RebuildDBReport > &  report)
protected

Definition at line 777 of file RpmDb.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  str,
const DbStateInfoBits obj 
)
friend

Definition at line 188 of file RpmDb.cc.

Member Data Documentation

◆ _dbStateInfo

DbStateInfoBits zypp::target::rpm::RpmDb::_dbStateInfo
private

Internal state info.

Definition at line 91 of file RpmDb.h.

◆ _root

Pathname zypp::target::rpm::RpmDb::_root
private

Root directory for all operations.

Definition at line 96 of file RpmDb.h.

◆ _dbPath

Pathname zypp::target::rpm::RpmDb::_dbPath
private

Directory that contains the rpmdb.

Definition at line 101 of file RpmDb.h.

◆ process

ExternalProgram* zypp::target::rpm::RpmDb::process
private

The connection to the rpm process.

Definition at line 351 of file RpmDb.h.

◆ exit_code

int zypp::target::rpm::RpmDb::exit_code
private

The exit code of the rpm process, or -1 if not yet known.

Definition at line 388 of file RpmDb.h.

◆ error_message

std::string zypp::target::rpm::RpmDb::error_message
private

Error message from running rpm as external program.

Use only if something fail.

Definition at line 394 of file RpmDb.h.

◆ _backuppath

Pathname zypp::target::rpm::RpmDb::_backuppath
private

/var/adm/backup

Definition at line 397 of file RpmDb.h.

◆ _packagebackups

bool zypp::target::rpm::RpmDb::_packagebackups
private

create package backups?

Definition at line 400 of file RpmDb.h.

◆ _warndirexists

bool zypp::target::rpm::RpmDb::_warndirexists
private

whether <_root>/<WARNINGMAILPATH> was already created

Definition at line 403 of file RpmDb.h.


The documentation for this class was generated from the following files: