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