Go to the documentation of this file.
15 #ifndef ZYPP_TARGET_RPM_RPMDB_H
16 #define ZYPP_TARGET_RPM_RPMDB_H
54 typedef class InstTargetError
Error;
85 return( (val_r & bits_r) == bits_r );
199 bool doRebuild_r =
false );
238 std::list<PublicKey>
pubkeys()
const;
257 std::list<FileInfo>
fileList(
const std::string & name_r,
const Edition & edition_r )
const;
263 bool hasFile(
const std::string & file_r,
const std::string & name_r =
"" )
const;
269 std::string
whoOwnsFile(
const std::string & file_r )
const;
274 bool hasProvides(
const std::string & tag_r )
const;
289 bool hasPackage(
const std::string & name_r )
const;
307 void getData(
const std::string & name_r,
415 const std::string& name,
417 const char* difffailmsg,
418 const char* diffgenmsg);
559 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
571 std::ostream &
operator<<( std::ostream &
str,
const RpmDb::CheckPackageDetail & obj );
577 #endif // ZYPP_TARGET_RPM_RPMDB_H
Date timestamp() const
timestamp of the rpm database (last modification)
std::ostream & operator<<(std::ostream &str, const librpmDb::DbDirInfo &obj)
void run_rpm(const RpmArgVec &options, ExternalProgram::Stderr_Disposition stderr_disp=ExternalProgram::Stderr_To_Stdout)
Run rpm with the specified arguments and handle stderr.
void removePubkey(const PublicKey &pubkey_r)
Remove a public key from the rpm database.
void doRebuildDatabase(callback::SendReport< RebuildDBReport > &report)
CheckPackageResult
checkPackage result
void closeDatabase()
Block further access to the rpm database and go back to uninitialized state.
std::set< Edition > pubkeyEditions() const
Return the edition of all installed public keys.
Pathname _backuppath
/var/adm/backup
void internal_initDatabase(const Pathname &root_r, const Pathname &dbPath_r, DbStateInfoBits &info_r)
Internal helper for initDatabase.
void setBackupPath(const Pathname &path)
set path where package backups are stored
bool hasConflicts(const std::string &tag_r) const
Return true if at least one package conflicts with a certain tag.
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).
bool backupPackage(const std::string &packageName)
create tar.gz of all changed files in a Package
Edition represents [epoch:]version[-release]
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"
Base class for reference counted objects.
void systemKill()
Forcably kill the system process.
void importZyppKeyRingTrustedKeys()
iterates through zypp keyring and import all non existant keys into rpm keyring
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,...
void exportTrustedKeysInZyppKeyRing()
insert all rpm trusted keys into zypp trusted keyring
Pathname _root
Root directory for all operations.
TraitsType::constPtrType constPtr
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
bool systemReadLine(std::string &line)
Read a line from the general rpm query.
void installPackage(const Pathname &filename, RpmInstFlags flags=RPMINST_NONE)
install rpm package
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.
void importPubkey(const PublicKey &pubkey_r)
Import ascii armored public key in file pubkey_r.
bool queryChangedFiles(FileList &fileList, const std::string &packageName)
determine which files of an installed package have been modified.
bool hasProvides(const std::string &tag_r) const
Return true if at least one package provides a certain tag.
void getData(const std::string &name_r, RpmHeader::constPtr &result_r) const
Get an installed packages data from rpmdb.
ExternalProgram * process
The connection to the rpm process.
@ SYNC_TO_KEYRING
export rpm trusted keys into zypp trusted keyring
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
bool hasPackage(const std::string &name_r) const
Return true if package is installed.
std::list< PublicKey > pubkeys() const
Return the long ids of all installed public keys.
void syncTrustedKeys(SyncTrustedKeyBits mode_r=SYNC_BOTH)
Sync trusted keys stored in rpm database and zypp trusted keyring.
Interface to the rpm program.
DbStateInfoBits _dbStateInfo
Internal state info.
Pathname _dbPath
Directory that contains the rpmdb.
Easy-to use interface to the ZYPP dependency resolver.
bool _packagebackups
create package backups?
void doInstallPackage(const Pathname &filename, RpmInstFlags flags, callback::SendReport< RpmInstallReport > &report)
void initDatabase(Pathname root_r=Pathname(), Pathname dbPath_r=Pathname(), bool doRebuild_r=false)
Prepare access to the rpm database.
SyncTrustedKeyBits
Sync mode for syncTrustedKeys.
Stderr_Disposition
Define symbols for different policies on the handling of stderr.
const Pathname & root() const
void rebuildDatabase()
Rebuild the rpm database (rpm –rebuilddb).
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 ...
bool dbsi_has(const DbStateInfoBits &val_r, const unsigned &bits_r) const
void dbsi_set(DbStateInfoBits &val_r, const unsigned &bits_r) const
void removePackage(const std::string &name_r, RpmInstFlags flags=RPMINST_NONE)
remove rpm package
bool _warndirexists
whether <_root>/<WARNINGMAILPATH> was already created
const Pathname & dbPath() const
void dbsi_clr(DbStateInfoBits &val_r, const unsigned &bits_r) const
bool hasRequiredBy(const std::string &tag_r) const
Return true if at least one package requires a certain tag.
friend std::ostream & operator<<(std::ostream &str, const DbStateInfoBits &obj)
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
Store and operate on date (time_t).
void createPackageBackups(bool yes)
whether to create package backups during install or removal
void doRemovePackage(const std::string &name_r, RpmInstFlags flags, callback::SendReport< RpmRemoveReport > &report)
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 !...
bool empty() const
Test for an empty path.
@ SYNC_FROM_KEYRING
import zypp trusted keys into rpm database.
void modifyDatabase()
Called before the database is modified by installPackage/removePackage.
Detailed rpm signature check log messages A single multiline message if CHK_OK.
Pathname getBackupPath(void)
get backup dir for rpm config files
std::set< std::string > FileList
std::string error_message
Error message from running rpm as external program.
String related utilities and Regular expression matching.
int exit_code
The exit code of the rpm process, or -1 if not yet known.
class InstTargetError Error
Default error class.
std::vector< const char * > RpmArgVec
std::string whoOwnsFile(const std::string &file_r) const
Return name of package owning file or empty string if no installed package owns file.
virtual std::ostream & dumpOn(std::ostream &str) const
Dump debug info.
int systemStatus()
Return the exit status of the general rpm process, closing the connection if not already done.