15 #ifndef ZYPP_TARGET_RPM_RPMDB_H 16 #define ZYPP_TARGET_RPM_RPMDB_H 40 class RpmPostTransCollector;
57 using Error =
class InstTargetError;
127 return( ! _root.
empty() );
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,
279 SYNC_TO_KEYRING = 1<<0,
280 SYNC_FROM_KEYRING = 1<<1,
281 SYNC_BOTH = SYNC_TO_KEYRING | SYNC_FROM_KEYRING
286 void syncTrustedKeys( SyncTrustedKeyBits mode_r = SYNC_BOTH );
291 void importZyppKeyRingTrustedKeys();
295 void exportTrustedKeysInZyppKeyRing();
322 bool systemReadLine(std::string &line);
361 void processConfigFiles(
const std::string& line,
362 const std::string& name,
364 const char* difffailmsg,
365 const char* diffgenmsg);
444 void removePackage(
const std::string & name_r, RpmInstFlags flags =
RPMINST_NONE );
447 void removePackage(
const std::string & name_r, RpmInstFlags flags,
RpmPostTransCollector* postTransCollector_r );
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);
497 _packagebackups = yes;
510 bool queryChangedFiles(FileList & fileList,
const std::string& packageName);
517 std::ostream &
dumpOn( std::ostream &
str )
const override;
535 #endif // ZYPP_TARGET_RPM_RPMDB_H
Interface to the rpm program.
TraitsType::constPtrType constPtr
db_const_iterator(const Pathname &root_r, const Pathname &dbPath_r)
class InstTargetError Error
Default error class.
Pathname _root
Root directory for all operations.
std::ostream & operator<<(std::ostream &str, const librpmDb::db_const_iterator &obj)
String related utilities and Regular expression matching.
std::vector< const char * > RpmArgVec
Edition represents [epoch:]version[-release]
Wrapper providing a librpmDb::db_const_iterator for this RpmDb.
Pathname getBackupPath(void)
get backup dir for rpm config files
Extract and remember posttrans scripts for later execution.
bool empty() const
Test for an empty path.
Pathname _backuppath
/var/adm/backup
int exit_code
The exit code of the rpm process, or -1 if not yet known.
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
Subclass to retrieve rpm database content.
SyncTrustedKeyBits
Sync mode for syncTrustedKeys.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Detailed rpm signature check log messages A single multiline message if CHK_OK.
ExternalProgram * process
The connection to the rpm process.
Stderr_Disposition
Define symbols for different policies on the handling of stderr.
Base class for reference counted objects.
std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
bool _packagebackups
create package backups?
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
const Pathname & root() const
const Pathname & dbPath() const
std::string error_message
Error message from running rpm as external program.
CheckPackageResult
checkPackage result
std::set< std::string > FileList
Easy-to use interface to the ZYPP dependency resolver.
Pathname _dbPath
Directory that contains the rpmdb.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.