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;
163 std::list<PublicKey>
pubkeys()
const;
182 std::list<FileInfo>
fileList(
const std::string & name_r,
const Edition & edition_r )
const;
188 bool hasFile(
const std::string & file_r,
const std::string & name_r =
"" )
const;
194 std::string
whoOwnsFile(
const std::string & file_r )
const;
199 bool hasProvides(
const std::string & tag_r )
const;
214 bool hasPackage(
const std::string & name_r )
const;
232 void getData(
const std::string & name_r,
337 const std::string& name,
339 const char* difffailmsg,
340 const char* diffgenmsg);
481 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
499 #endif // ZYPP_TARGET_RPM_RPMDB_H
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 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
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.
std::ostream & operator<<(std::ostream &str, const librpmDb::db_const_iterator &obj)
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.
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)
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 ...
void removePackage(const std::string &name_r, RpmInstFlags flags=RPMINST_NONE)
remove rpm package
const Pathname & dbPath() const
bool hasRequiredBy(const std::string &tag_r) const
Return true if at least one package requires a certain tag.
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
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.
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.
void initDatabase(Pathname root_r=Pathname(), bool doRebuild_r=false)
Prepare access to the rpm database at /var/lib/rpm.
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.