15#ifndef ZYPP_TARGET_RPM_RPMDB_H 
   16#define ZYPP_TARGET_RPM_RPMDB_H 
   57  using Error = 
class InstTargetError;
 
  127    return( ! 
_root.empty() );
 
 
  133  db_const_iterator dbConstIterator() 
const;
 
  149  void initDatabase( 
Pathname root_r = 
Pathname(), 
bool doRebuild_r = 
false );
 
  159  void closeDatabase();
 
  167  void rebuildDatabase();
 
  175  void importPubkey( 
const PublicKey & pubkey_r );
 
  183  void removePubkey( 
const PublicKey & pubkey_r );
 
  188  std::list<PublicKey> pubkeys() 
const;
 
  193  std::set<Edition> pubkeyEditions() 
const;
 
  207  std::list<FileInfo> fileList( 
const std::string & name_r, 
const Edition & edition_r ) 
const;
 
  213  bool hasFile( 
const std::string & file_r, 
const std::string & name_r = 
"" ) 
const;
 
  219  std::string whoOwnsFile( 
const std::string & file_r ) 
const;
 
  224  bool hasProvides( 
const std::string & tag_r ) 
const;
 
  229  bool hasRequiredBy( 
const std::string & tag_r ) 
const;
 
  234  bool hasConflicts( 
const std::string & tag_r ) 
const;
 
  239  bool hasPackage( 
const std::string & name_r ) 
const;
 
  244  bool hasPackage( 
const std::string & name_r, 
const Edition & ed_r ) 
const;
 
  257  void getData( 
const std::string & name_r,
 
  269  void getData( 
const std::string & name_r, 
const Edition & ed_r,
 
  286  void syncTrustedKeys( SyncTrustedKeyBits mode_r = SYNC_BOTH );
 
  291  void importZyppKeyRingTrustedKeys();
 
  295  void exportTrustedKeysInZyppKeyRing();
 
  362                          const std::string& name,
 
  364                          const char* difffailmsg,
 
  365                          const char* diffgenmsg);
 
  454  int runposttrans( 
const Pathname & filename_r, 
const std::function<
void(
const std::string&)>& output_r );
 
  472  bool backupPackage(
const std::string& packageName);
 
  480  bool backupPackage(
const Pathname& filename);
 
  487  void setBackupPath(
const Pathname& path);
 
  510  bool queryChangedFiles(FileList & fileList, 
const std::string& packageName);
 
  517  std::ostream & 
dumpOn( std::ostream & 
str ) 
const override;
 
 
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
Base class for reference counted objects.
Extract and remember posttrans scripts for later execution.
std::string error_message
Error message from running rpm as external program.
std::vector< const char * > RpmArgVec
class InstTargetError Error
Default error class.
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.
int runposttrans(const Pathname &filename_r, const std::function< void(const std::string &)> &output_r)
Run collected posttrans and transfiletrigger(postun|in) if rpm --runposttrans is supported.
ExternalProgram * process
The connection to the rpm process.
SyncTrustedKeyBits
Sync mode for syncTrustedKeys.
@ SYNC_TO_KEYRING
export rpm trusted keys into zypp trusted keyring
@ SYNC_FROM_KEYRING
import zypp trusted keys into rpm database.
int systemStatus()
Return the exit status of the general rpm process, closing the connection if not already done.
std::set< std::string > FileList
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).
void systemKill()
Forcably kill the system process.
const Pathname & root() const
void removePackage(const std::string &name_r, RpmInstFlags flags=RPMINST_NONE)
remove rpm package
void createPackageBackups(bool yes)
whether to create package backups during install or removal
const Pathname & dbPath() const
Pathname _dbPath
Directory that contains the rpmdb.
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,...
Pathname getBackupPath(void)
get backup dir for rpm config files
Pathname _root
Root directory for all operations.
int exit_code
The exit code of the rpm process, or -1 if not yet known.
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"
CheckPackageResult
checkPackage result
bool systemReadLine(std::string &line)
Read a line from the general rpm query.
Subclass to retrieve rpm database content.
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
std::ostream & operator<<(std::ostream &str, const librpmDb::db_const_iterator &obj)
std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
Easy-to use interface to the ZYPP dependency resolver.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Detailed rpm signature check log messages A single multiline message if CHK_OK.
db_const_iterator(const Pathname &root_r, const Pathname &dbPath_r)